Changeset 65

Show
Ignore:
Timestamp:
06/24/08 07:26:45 (2 months ago)
Author:
kaarna
Message:

Paned widget.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/pihlaja/src/pihlaja/PihlajaMain.d

    r64 r65  
    3939import shiraz.ui.Window; 
    4040import shiraz.ui.SubWindow; 
     41import shiraz.ui.Paned; 
    4142import shiraz.ui.Button; 
    4243import shiraz.ui.ProgressBar; 
     
    10411042        // 
    10421043         
    1043         videoViewerWindow.add(videoViewer); 
     1044        ProgressBar testProgressBar = new ProgressBar("Testing..."); 
     1045        testProgressBar.fraction = 0.7f; 
     1046         
     1047        /*auto emptyButton41 = new Button("Paned Button"); 
     1048        auto emptyButton42 = new Button("Paned Button"); 
     1049        auto emptyButton43 = new Button("Paned Button"); 
     1050        auto emptyButton44 = new Button("Paned Button");*/ 
     1051         
     1052        VPaned vpaned = new VPaned(); 
     1053        vpaned.add(testProgressBar); 
     1054        vpaned.add(videoViewer); 
     1055         
     1056        HPaned hpaned = new HPaned(); 
     1057        hpaned.add( vpaned ); 
     1058        //vpaned.add(testProgressBar); 
     1059        //vpaned.add(videoViewer); 
     1060        //vpaned.add(emptyButton41); 
     1061        //vpaned.add(emptyButton42); 
     1062        //vpaned.add(emptyButton43); 
     1063        //vpaned.add(emptyButton44); 
     1064         
     1065        SubWindow awin28 = new SubWindow("Timeline"); 
     1066        awin28.defaultSize( 0.4f, 0.4f ); 
     1067        awin28.side1.container.arrangeType = ArrangeType.FREE; 
     1068        awin28.side1.container.verticalScrollbarSetting = ScrollbarSetting.ALWAYS; 
     1069        awin28.side1.container.horizontalScrollbarSetting = ScrollbarSetting.ALWAYS; 
     1070        awin28.side1.isDoubleSided = true; 
     1071        awin28.side2.a = 0.5f; 
     1072        //awin28.add(checkerBoard2); 
     1073         
     1074        //Window in window test 
     1075            SubWindow winwin2 = new SubWindow("Window in Window"); 
     1076            winwin2.defaultSize( 0.4f, 0.2f ); 
     1077             
     1078            auto emptyButton128 = new Button("Crazy Button 1"); 
     1079            emptyButton128.signalActivate.attach(&clickHandler3); 
     1080            winwin2.add( emptyButton128 );       
     1081            auto emptyButton228 = new Button("Crazy Button 2"); 
     1082            emptyButton228.signalActivate.attach(&clickHandler3); 
     1083            winwin2.add( emptyButton228 ); 
     1084             
     1085            awin28.add( winwin2 ); 
     1086        // 
     1087         
     1088        hpaned.add( awin28 ); 
     1089         
     1090        // 
     1091         
     1092        videoViewerWindow.add( hpaned ); 
     1093        //videoViewerWindow.add(videoViewer); 
    10441094        videoViewerWindow.add(viewerButtonBox); 
    10451095        //videoViewerWindow.add(playButton2); 
  • trunk/pihlaja/src/shiraz/canvas/Rectangle.d

    r64 r65  
    29192919                foreach( Rectangle wid; itemList ) 
    29202920                { 
    2921                     Trace.formatln("wid.name: {} height: {}", wid.name, cast(double) wid.h ); 
     2921                    debug(arrange) Trace.formatln("wid.name: {} height: {}", wid.name, cast(double) wid.h ); 
    29222922                    if( result < (wid.h + wid.padding*2.0f) ) 
    29232923                        result = (wid.h + wid.padding*2.0f); 
     
    32093209                            { 
    32103210                                wid.hN = wid.childrenHeight(); 
    3211                                 Trace.formatln("wid.childrenHeight: {}", cast(double) wid.childrenHeight() ); 
     3211                                debug(arrange) Trace.formatln("wid.childrenHeight: {}", cast(double) wid.childrenHeight() ); 
    32123212                            } 
    32133213                        } 
     
    34343434                            { 
    34353435                                wid.hN = wid.childrenHeight(); 
    3436                                 Trace.formatln("wid.childrenHeight: {}", cast(double) wid.childrenHeight() ); 
     3436                                debug(arrange) Trace.formatln("wid.childrenHeight: {}", cast(double) wid.childrenHeight() ); 
    34373437                            } 
    34383438                            //else if( wid.hasMinHeight == true ) 
  • trunk/pihlaja/src/shiraz/core/globals.d

    r27 r65  
    2323debug(logging) import tango.util.log.Trace;//Thread safe console output. 
    2424 
     25public enum DirectionType 
     26{ 
     27    HORIZONTAL, 
     28    VERTICAL 
     29} 
     30 
    2531import shiraz.Shiraz; 
    2632 
     
    3339 
    3440 
     41 
     42 
  • trunk/pihlaja/src/shiraz/ui/Scrollbar.d

    r61 r65  
    4848} 
    4949 
    50 enum DirectionType 
    51 { 
    52     HORIZONTAL, 
    53     VERTICAL 
    54 } 
    55  
    5650class MakeSomeSenseToThisButton : Button 
    5751{ 
     
    227221                //how bad I'm with mathematics. Someone could make this nicer but it works 
    228222                //this way too. Thank you. 
    229                 Trace.formatln("HORIZONTAL value: {}", cast(double) value ); 
     223                debug(Scrollbar) Trace.formatln("HORIZONTAL value: {}", cast(double) value ); 
    230224            } 
    231225        } 
     
    236230                float diff = (-(h*0.5f)+(controlRect.h*0.5)) - controlRect.yPos; 
    237231                value = (diff / ((h*0.5f)-(controlRect.h*0.5))) * -0.5f; 
    238                 Trace.formatln("VERTICAL value: {}", cast(double) value ); 
     232                debug(Scrollbar) Trace.formatln("VERTICAL value: {}", cast(double) value ); 
    239233            } 
    240234        } 
     
    250244                controlRect.xPos = (multiple * (w*0.5f)) - (multiple * (controlRect.w*0.5)); 
    251245                 
    252                 Trace.formatln("HORIZONTAL value: {} multiple: {}", cast(double) value, cast(double) multiple ); 
     246                debug(Scrollbar) Trace.formatln("HORIZONTAL value: {} multiple: {}", cast(double) value, cast(double) multiple ); 
    253247            } 
    254248        } 
     
    260254                controlRect.yPos = (multiple * (h*0.5f)) - (multiple * (controlRect.h*0.5)); 
    261255                 
    262                 Trace.formatln("VERTICAL value: {} multiple: {}", cast(double) value, cast(double) multiple ); 
     256                debug(Scrollbar) Trace.formatln("VERTICAL value: {} multiple: {}", cast(double) value, cast(double) multiple ); 
    263257            } 
    264258        }