[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-commits] Commit Complete



Commit by  : alex
Repository : xara
Revision   : 1335
Date       : Sat Jun 17 11:07:14 BST 2006

Changed paths:
   M /Trunk/XaraLX/Scripts/rc2xml.pl
   M /Trunk/XaraLX/wxOil/xrc/EN/blobtab.xrc
   M /Trunk/XaraLX/wxOil/xrc/EN/prefsdlg.xrc
   M /Trunk/XaraLX/wxOil/xrc/EN/printdlg.xrc
   M /Trunk/XaraLX/wxOil/xrc/EN/richard.xrc

Convert read-only text fields in dialogs properly
Convert combo boxes requiring multiple style flags set properly


Diff:
Index: Trunk/XaraLX/Scripts/rc2xml.pl
===================================================================
--- Trunk/XaraLX/Scripts/rc2xml.pl	(revision 1334)
+++ Trunk/XaraLX/Scripts/rc2xml.pl	(revision 1335)
@@ -208,6 +208,14 @@
     return 1;
 }
 
+# Add a style
+sub AddStyle
+{
+    my $newstyle = shift @_;
+    my $rstyle = shift @_;
+    $$rstyle.=(($$rstyle ne "")?"|":"").$newstyle;
+}
+
 # Read a rectangle
 sub ReadRect
 {
@@ -523,21 +531,20 @@
 sub ParseTextCtrl
 {
     my $varname = shift @_;
-    my $token = PeekToken ();
-    while ($token !~ /^\d+$/ )
+    my $token;
+    my $GotOrs = ReadOrs (\$token);
+    my @rect;
+    if (ReadRect(\@rect))
     {
-	GetToken ();
-	$token = PeekToken ();
+	ReadOrs (\$token) unless $GotOrs;
     }
 
-    # read position
-    my @rect;
-    ReadRect(\@rect);
-
+    my $style;
     print OUTPUT "		<object class=\"wxTextCtrl\"";
     WriteBasicInfo (@rect, $varname);
+    AddStyle ("wxTE_READONLY",\$style) if ($token =~ /ES_READONLY/);
+    WriteStyle($style);
     print OUTPUT "		</object>
";
-
 }
 
 # AUTOCHECKBOX "&log.", ID_XLOG, 25, 24, 21, 12
@@ -602,12 +609,14 @@
     # value. wxWidgets then centres them vertically which result in a vertical offset
     $rect[3]=-1;
 
+    my $style;
     print OUTPUT "		<object class=\"wxOwnerDrawnComboBox\"";
     WriteBasicInfo (@rect, $varname);
-    WriteStyle ("wxCB_SIMPLE") if ($token =~ /CBS_SIMPLE/);
-    WriteStyle ("wxCB_SORT") if ($token =~ /CBS_SORT/);
-    WriteStyle ("wxCB_ALWAYS_SB") if ($token =~ /CBS_DISABLENOSCROLL/);
-    WriteStyle ("wxCB_READONLY") if ($token =~ /CBS_DROPDOWNLIST/);
+    AddStyle ("wxCB_SIMPLE",\$style) if ($token =~ /CBS_SIMPLE/);
+    AddStyle ("wxCB_SORT",\$style) if ($token =~ /CBS_SORT/);
+    AddStyle ("wxCB_ALWAYS_SB",\$style) if ($token =~ /CBS_DISABLENOSCROLL/);
+    AddStyle ("wxCB_READONLY",\$style) if ($token =~ /CBS_DROPDOWNLIST/);
+    WriteStyle($style);
     print OUTPUT "		</object>
";
 }
 
Index: Trunk/XaraLX/wxOil/xrc/EN/prefsdlg.xrc
===================================================================
--- Trunk/XaraLX/wxOil/xrc/EN/prefsdlg.xrc	(revision 1334)
+++ Trunk/XaraLX/wxOil/xrc/EN/prefsdlg.xrc	(revision 1335)
@@ -328,6 +328,7 @@
 		</object>
 		<object class="wxTextCtrl" name="IDC_EDIT_CURRENTCACHE">
 			 <pos>145,167d</pos> <size>50,12d</size>
+			<style>wxTE_READONLY</style>
 		</object>
 		<object class="wxStaticText" name="IDC_STATIC_">
 			 <pos>16,169d</pos> <size>125,8d</size>
Index: Trunk/XaraLX/wxOil/xrc/EN/blobtab.xrc
===================================================================
--- Trunk/XaraLX/wxOil/xrc/EN/blobtab.xrc	(revision 1334)
+++ Trunk/XaraLX/wxOil/xrc/EN/blobtab.xrc	(revision 1335)
@@ -67,8 +67,7 @@
 		</object>
 		<object class="wxOwnerDrawnComboBox" name="IDC_TCOMBO4">
 			 <pos>85,22d</pos> <size>48,-1d</size>
-			<style>wxCB_SORT</style>
-			<style>wxCB_READONLY</style>
+			<style>wxCB_SORT|wxCB_READONLY</style>
 		</object>
 		<object class="wxStaticText" name="IDC_TSTDEF">
 			 <pos>16,11d</pos> <size>30,8d</size>
@@ -209,8 +208,7 @@
 		</object>
 		<object class="wxOwnerDrawnComboBox" name="IDC_COMBO4">
 			 <pos>89,182d</pos> <size>48,-1d</size>
-			<style>wxCB_SORT</style>
-			<style>wxCB_READONLY</style>
+			<style>wxCB_SORT|wxCB_READONLY</style>
 		</object>
 		<object class="wxStaticBox" name="IDC_STCONV">
 			 <pos>4,160d</pos> <size>233,86d</size>
Index: Trunk/XaraLX/wxOil/xrc/EN/richard.xrc
===================================================================
--- Trunk/XaraLX/wxOil/xrc/EN/richard.xrc	(revision 1334)
+++ Trunk/XaraLX/wxOil/xrc/EN/richard.xrc	(revision 1335)
@@ -43,8 +43,7 @@
 		</object>
 		<object class="wxOwnerDrawnComboBox" name="ID_STATICDECIMAL_1137">
 			 <pos>6,132d</pos> <size>142,-1d</size>
-			<style>wxCB_SORT</style>
-			<style>wxCB_READONLY</style>
+			<style>wxCB_SORT|wxCB_READONLY</style>
 		</object>
 		<object class="wxButton" name="wxID_OK">
 			 <pos>154,26d</pos> <size>50,14d</size>
@@ -112,8 +111,7 @@
 		</object>
 		<object class="wxOwnerDrawnComboBox" name="ID_STATICDECIMAL_1137">
 			 <pos>6,132d</pos> <size>142,-1d</size>
-			<style>wxCB_SORT</style>
-			<style>wxCB_READONLY</style>
+			<style>wxCB_SORT|wxCB_READONLY</style>
 		</object>
 		<object class="wxButton" name="wxID_OK">
 			 <pos>154,26d</pos> <size>50,14d</size>
Index: Trunk/XaraLX/wxOil/xrc/EN/printdlg.xrc
===================================================================
--- Trunk/XaraLX/wxOil/xrc/EN/printdlg.xrc	(revision 1334)
+++ Trunk/XaraLX/wxOil/xrc/EN/printdlg.xrc	(revision 1335)
@@ -451,8 +451,7 @@
 		</object>
 		<object class="wxOwnerDrawnComboBox" name="IDC_COMBOTYPE">
 			 <pos>110,75d</pos> <size>84,-1d</size>
-			<style>wxCB_SORT</style>
-			<style>wxCB_READONLY</style>
+			<style>wxCB_SORT|wxCB_READONLY</style>
 		</object>
 		<object class="wxCheckBox" name="IDC_CHECKSEPARATIONS">
 			 <pos>11,95d</pos> <size>89,8d</size>


Xara