Changeset 72
- Timestamp:
- 07/16/08 05:52:00 (5 months ago)
- Files:
-
- trunk/pihlaja/src/shiraz/canvas/IRootWindow.d (modified) (1 diff)
- trunk/pihlaja/src/shiraz/ui/SubWindow.d (modified) (1 diff)
- trunk/pihlaja/src/shiraz/ui/Window.d (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/pihlaja/src/shiraz/canvas/IRootWindow.d
r63 r72 42 42 43 43 //For to be able to create MenuWindows... 44 void add( Rectangle a_widget ); 45 void remove( Rectangle a_widget ); 44 void addToCanvas( Rectangle a_widget ); 45 void removeFromCanvas( Rectangle a_widget ); 46 //void add( Rectangle a_widget ); 47 //void remove( Rectangle a_widget ); 46 48 } 47 49 trunk/pihlaja/src/shiraz/ui/SubWindow.d
r71 r72 1662 1662 { 1663 1663 Trace.formatln("Adding menuWindow into rootWindow for the first time."); 1664 rootWindow.add ( menuWindow );1664 rootWindow.addToCanvas( menuWindow ); 1665 1665 } 1666 1666 menuWindow.show(); trunk/pihlaja/src/shiraz/ui/Window.d
r71 r72 28 28 import Shz = shiraz.ui.InputState; 29 29 import shiraz.ui.EventType; 30 import Sh zr= shiraz.ui.Widget;30 import Shrz = shiraz.ui.Widget; 31 31 import shiraz.ui.SubWindow; 32 32 import shiraz.canvas.ICanvasItem; … … 652 652 } 653 653 654 class Window : public PlainWindow, public IRootWindow654 class Window : public Shrz.Widget, public IRootWindow 655 655 { 656 656 //char[] name = ""; … … 686 686 Trace.formatln("Before Window.super()."); 687 687 688 super(); 689 name = set_name; 690 arrangeType = ArrangeType.LAYER; 691 688 692 //super(set_name, WindowHeaderType.NORMAL, WindowHeaderType.NORMAL, true, false );//isfrontside=true, use_fbo_clipping=false 689 super(set_name, WindowHeaderType.NONE, WindowHeaderType.NONE, true, false );//isfrontside=true, use_fbo_clipping=false 693 //super(set_name, WindowHeaderType.NONE, WindowHeaderType.NONE, true, false );//isfrontside=true, use_fbo_clipping=false 694 plainWindow = new PlainWindow(set_name, WindowHeaderType.NONE, WindowHeaderType.NONE, true, false );//isfrontside=true, use_fbo_clipping=false 695 addToCanvas(plainWindow); 690 696 691 697 Trace.formatln("After Window.super()."); 692 698 } 699 700 PlainWindow plainWindow; 693 701 694 702 /* … … 748 756 749 757 //These are overridden from Widget. 758 750 759 //FALSE: Currently these return pixel-coordinates. 751 760 //Maybe that's not what is good. Maybe we should … … 756 765 public float w( float set ) 757 766 { 758 Trace.formatln(" Can't yet set Window width in height coordinates.");767 Trace.formatln("Window.w() Can't yet set Window width in height coordinates."); 759 768 throw new Exception("Can't yet set Window width in height coordinates."); 760 769 return _w = set; 761 770 } 771 public float wN( float set ) 772 { 773 Trace.formatln("Window.wN() Can't yet set Window width in height coordinates."); 774 throw new Exception("Can't yet set Window width in height coordinates."); 775 return _w = set; 776 } 762 777 protected float _w = 1.33333f; 763 778 … … 765 780 public float h( float set ) 766 781 { 767 Trace.formatln(" Can't yet set Window height in height coordinates.");782 Trace.formatln("Window.h() Can't yet set Window height in height coordinates."); 768 783 throw new Exception("Can't yet set Window height in height coordinates."); 769 784 return _h = set; 770 785 } 786 public float hN( float set ) 787 { 788 Trace.formatln("Window.hN() Can't yet set Window height in height coordinates."); 789 throw new Exception("Can't yet set Window height in height coordinates."); 790 return _h = set; 791 } 771 792 protected float _h = 1.0f; 772 793 … … 775 796 { 776 797 _wP = set; 777 //_w = p2hco_rel_x(set); 778 super.w( p2hco_rel_x(set) ); 798 //Trace.formatln("wP: set: {}", cast(double)set ); 799 _w = p2hco_rel_x(set); 800 _ix1 = -(_w * 0.5f); 801 _ix2 = _w * 0.5f; 802 //super.w( p2hco_rel_x(set) ); 803 //Trace.formatln("wP: p2hco_rel_x(set): {}", cast(double)p2hco_rel_x(set) ); 804 //Trace.formatln("wP: _w: {}", cast(double)_w ); 805 //Trace.formatln("wP: screenHeightP: {}", cast(double)screenHeightP ); 806 arrange(); 807 invalidate(); 779 808 return _wP; 780 809 } … … 785 814 { 786 815 _hP = set; 787 //_h = p2hco_rel_y(set); 788 super.h( p2hco_rel_y(set) ); 816 _h = p2hco_rel_y(set); 817 _iy1 = -(_h * 0.5f); 818 _iy2 = _h * 0.5f; 819 //super.h( p2hco_rel_y(set) ); 820 arrange(); 821 invalidate(); 789 822 return _hP; 790 823 } … … 926 959 //Trace.format("{} ", *ptr); 927 960 928 foreach( Sh zr.Widget wid; itemList )961 foreach( Shrz.Widget wid; itemList ) 929 962 { 930 963 if( wid.pickingID == *ptr ) … … 974 1007 */ 975 1008 //The faster manual version: 976 /*foreach( Sh zr.Widget wid; itemList )1009 /*foreach( Shrz.Widget wid; itemList ) 977 1010 { 978 1011 if( wid.mouseEvent( input ) ) … … 983 1016 984 1017 //First check which ones were hit. 985 scope LinkSeq!(Sh zr.Widget) hitlist = enclosureList(input);1018 scope LinkSeq!(Shrz.Widget) hitlist = enclosureList(input); 986 1019 //Best zOrder widget will be in .tail. 987 1020 hitlist.tail.mouseEvent( input ); … … 1086 1119 1087 1120 1088 //void add( Sh zr.Widget a_widget )1121 //void add( Shrz.Widget a_widget ) 1089 1122 void add( Rectangle a_widget ) 1123 { 1124 a_widget.rootWindow = this; 1125 plainWindow.add( a_widget ); 1126 arrange(); 1127 invalidate(); 1128 } 1129 1130 void remove( Rectangle a_widget ) 1131 { 1132 //a_widget.rootWindow = this; 1133 plainWindow.remove( a_widget ); 1134 arrange(); 1135 invalidate(); 1136 } 1137 1138 void append( Rectangle a_widget ) 1139 { 1140 a_widget.rootWindow = this; 1141 plainWindow.append( a_widget ); 1142 arrange(); 1143 invalidate(); 1144 } 1145 1146 void prepend( Rectangle a_widget ) 1147 { 1148 a_widget.rootWindow = this; 1149 plainWindow.prepend( a_widget ); 1150 arrange(); 1151 invalidate(); 1152 } 1153 1154 void addToCanvas( Rectangle a_widget ) 1090 1155 { 1091 1156 a_widget.rootWindow = this; … … 1093 1158 } 1094 1159 1095 void remove ( Rectangle a_widget )1160 void removeFromCanvas( Rectangle a_widget ) 1096 1161 { 1097 1162 //a_widget.rootWindow = this; … … 1101 1166 //protected 1102 1167 1168 /* 1103 1169 void arrange() 1104 1170 { 1105 checkZOrder(); 1171 super.arrange(); 1172 //checkZOrder(); 1173 1174 //Trace.formatln("win w: {} h: {}", cast(double)w, cast(double)h ); 1106 1175 1107 1176 //Trace.formatln("This size: {}", toString() ); … … 1116 1185 //} 1117 1186 } 1187 */ 1118 1188 1119 1189 … … 1326 1396 //and to let the objects lie in the 0.0 z-plane. 1327 1397 1328 //foreach(Sh zr.Widget wid; itemList)1398 //foreach(Shrz.Widget wid; itemList) 1329 1399 foreach(Rectangle wid; itemList) 1330 1400 {
