summaryrefslogtreecommitdiffstats
path: root/qtsharp/src/uicsharp/uicsharp.cs
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-05 15:55:57 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-12-05 15:55:57 -0600
commit9ba04742771370f59740e32e11c5f3a1e6a1b70a (patch)
treec81c34dae2b3b1ea73801bf18a960265dc4207f7 /qtsharp/src/uicsharp/uicsharp.cs
parent1a96c45b22d01378202d9dc7ed9c47acd30f966e (diff)
downloadtdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.tar.gz
tdebindings-9ba04742771370f59740e32e11c5f3a1e6a1b70a.zip
Initial TQt conversion
Diffstat (limited to 'qtsharp/src/uicsharp/uicsharp.cs')
-rw-r--r--qtsharp/src/uicsharp/uicsharp.cs72
1 files changed, 36 insertions, 36 deletions
diff --git a/qtsharp/src/uicsharp/uicsharp.cs b/qtsharp/src/uicsharp/uicsharp.cs
index 62a67757..32587f4b 100644
--- a/qtsharp/src/uicsharp/uicsharp.cs
+++ b/qtsharp/src/uicsharp/uicsharp.cs
@@ -63,7 +63,7 @@ namespace QtSharp {
try {
String []dummyargs=new String[0];
- TQApplication dummyapp=new TQApplication(dummyargs,false);
+ TTQApplication dummyapp=new TTQApplication(dummyargs,false);
qtAssembly=Assembly.GetAssembly(dummyapp.GetType());
// qtAssembly=Assembly.Load("Qt.dll");
Console.WriteLine("CodeBase="+qtAssembly.CodeBase);
@@ -216,7 +216,7 @@ namespace QtSharp {
"\"....#aaaaaaaaaaaaa#...\",\"....#aaaaaaaaaaaaa#...\",\"....#aaaaaaaaaaaaa#...\","+
"\"....#aaaaaaaaaaaaa#...\",\"....#aaaaaaaaaaaaa#...\",\"....###############...\","+
"\"......................\",\"......................\"};");
- writer.WriteLine("\tQPixmap {0};",el.GetAttribute("name"));
+ writer.WriteLine("\tTQPixmap {0};",el.GetAttribute("name"));
}
}
@@ -225,11 +225,11 @@ namespace QtSharp {
{
if (menubarElement==null) return;
writer.WriteLine("\t//Menubar member fields");
- writer.WriteLine("\t TQMenuBar menubar;");
+ writer.WriteLine("\t TTQMenuBar menubar;");
foreach (XmlNode node in menubarElement.ChildNodes) {
XmlElement el=node as XmlElement;
if (el.Name=="item") {
- writer.WriteLine("\tpublic TQPopupMenu {0};",el.GetAttribute("name"));
+ writer.WriteLine("\tpublic TTQPopupMenu {0};",el.GetAttribute("name"));
}
}
}
@@ -241,7 +241,7 @@ namespace QtSharp {
foreach (XmlNode node in actionsElement.ChildNodes) {
XmlElement el=node as XmlElement;
if (el.Name=="action") {
- writer.WriteLine("\tpublic TQAction {0};",getName(el));
+ writer.WriteLine("\tpublic TTQAction {0};",getName(el));
}
}
}
@@ -253,7 +253,7 @@ namespace QtSharp {
foreach (XmlNode node in toolbarsElement.ChildNodes) {
XmlElement el=node as XmlElement;
if (el.Name=="toolbar") {
- writer.WriteLine("\tpublic TQToolBar {0};",getName(el));
+ writer.WriteLine("\tpublic TTQToolBar {0};",getName(el));
}
}
}
@@ -269,7 +269,7 @@ namespace QtSharp {
if (submembernode.ParentNode!=widget) continue; // I think this is a workaround for a classlib bug
XmlElement submember=submembernode as XmlElement;
addSubMembers(submember);
- if (submember.GetAttribute("class")=="QLayoutWidget") continue; //they are private
+ if (submember.GetAttribute("class")=="TQLayoutWidget") continue; //they are private
String membername=getName(submember);
if (membername==String.Empty) continue;
writer.WriteLine("\t"+submember.GetAttribute("class")+" "+membername+";");
@@ -334,7 +334,7 @@ namespace QtSharp {
tmp=tmp.NextSibling as XmlElement;
String slot=tmp.InnerText;
- writer.WriteLine("\t\tQObject.Connect({0},TQT_SIGNAL(\"{1}\"),{2},TQT_SLOT(\"{3}\"));",
+ writer.WriteLine("\t\tTQObject.Connect({0},TQT_SIGNAL(\"{1}\"),{2},TQT_SLOT(\"{3}\"));",
sender,signal,receiver,slot);
}
break;
@@ -346,7 +346,7 @@ namespace QtSharp {
private void createConstructor()
{
//Later handle non qwidgets better (dialog,....)
- writer.WriteLine("\n\tpublic "+className+"(TQWidget parent, String name) :base(parent, name) {");
+ writer.WriteLine("\n\tpublic "+className+"(TTQWidget parent, String name) :base(parent, name) {");
writer.WriteLine("\t\tif (name==null) SetName(\""+className+"\");");
setupImages();
setupActions();
@@ -370,7 +370,7 @@ namespace QtSharp {
writer.WriteLine("\t//images");
foreach (XmlNode node in imagesElement.ChildNodes) {
XmlElement el=node as XmlElement;
- writer.WriteLine("\t\t{0}=new TQPixmap({1}_data);",
+ writer.WriteLine("\t\t{0}=new TTQPixmap({1}_data);",
el.GetAttribute("name"),el.GetAttribute("name"));
}
}
@@ -382,7 +382,7 @@ namespace QtSharp {
foreach (XmlNode aNode in actionsElement.ChildNodes) {
XmlElement action=aNode as XmlElement;
if (action.Name!="action") continue;
- writer.WriteLine("\t\t{0}= new TQAction(this,\"{1}\");",getName(action),getName(action));
+ writer.WriteLine("\t\t{0}= new TTQAction(this,\"{1}\");",getName(action),getName(action));
foreach (XmlNode pNode in action.ChildNodes) {
XmlElement prop=pNode as XmlElement;
if (prop.Name!="property") continue;
@@ -398,14 +398,14 @@ namespace QtSharp {
if (menubarElement==null) return;
writer.WriteLine("\t//menubar");
String barname=getName(menubarElement);
- writer.WriteLine("\t\t{0}=new TQMenuBar(this,\"{1}\");",barname,barname);
+ writer.WriteLine("\t\t{0}=new TTQMenuBar(this,\"{1}\");",barname,barname);
int count=0;
foreach (XmlNode mNode in menubarElement.ChildNodes) {
XmlElement item=mNode as XmlElement;
if (item.Name!="item") continue;
String submenu_name=item.GetAttribute("name");
String submenu_text=stringify(item.GetAttribute("text"));
- writer.WriteLine("\t\t{0}=new TQPopupMenu(this);",submenu_name);
+ writer.WriteLine("\t\t{0}=new TTQPopupMenu(this);",submenu_name);
foreach (XmlNode node in item.ChildNodes) {
XmlElement element=node as XmlElement;
@@ -428,7 +428,7 @@ namespace QtSharp {
XmlElement toolbar=tNode as XmlElement;
if (toolbar.Name!="toolbar") continue;
String varname=getName(toolbar);
- writer.WriteLine("\t\t{0}=new TQToolBar(this,\"{1}\");",varname,varname);
+ writer.WriteLine("\t\t{0}=new TTQToolBar(this,\"{1}\");",varname,varname);
writer.WriteLine("\t\tthis.AddDockWindow({0},(Qt.Dock){1},false);",varname,toolbar.GetAttribute("dock"));
foreach (XmlNode node in toolbar.ChildNodes) {
XmlElement element=node as XmlElement;
@@ -442,7 +442,7 @@ namespace QtSharp {
private ElementType elementType(XmlElement el)
{
switch (el.Name) {
- case "widget": return (el.GetAttribute("class")=="QLayoutWidget")?
+ case "widget": return (el.GetAttribute("class")=="TQLayoutWidget")?
ElementType.LayoutType:ElementType.WidgetType;
case "vbox": return ElementType.LayoutType;
case "hbox": return ElementType.LayoutType;
@@ -473,7 +473,7 @@ namespace QtSharp {
private void widgetAdd(String parname,XmlElement par, XmlElement obj)
{
if (par==widgetElement) {
- if (par.GetAttribute("class")=="TQWizard")
+ if (par.GetAttribute("class")=="TTQWizard")
{
writer.WriteLine("\t\tAddPage("+getName(obj)+", "+getName(obj)+".Caption());");
}
@@ -486,7 +486,7 @@ namespace QtSharp {
else writer.WriteLine("\t\t"+parname+".Add("+getName(obj)+");");
}
else switch(par.GetAttribute("class")) {
- case "TQTabWidget": writer.WriteLine("\t\t"+parname+".InsertTab("+getName(obj)+",\"\");");
+ case "TTQTabWidget": writer.WriteLine("\t\t"+parname+".InsertTab("+getName(obj)+",\"\");");
break;
default: break;
}
@@ -575,10 +575,10 @@ namespace QtSharp {
break;
}
}
- writer.WriteLine("\t\tQSpacerItem {0}=new TQSpacerItem({1},{2},{3},{4});",
+ writer.WriteLine("\t\tTQSpacerItem {0}=new TTQSpacerItem({1},{2},{3},{4});",
name,shx,shy,
- (orientation=="VERTICAL")?"Qt.TQSizePolicy.SizeType.Minimum":("Qt.TQSizePolicy.SizeType."+toPascal(sizeType)),
- (orientation!="VERTICAL")?"Qt.TQSizePolicy.SizeType.Minimum":("Qt.TQSizePolicy.SizeType."+toPascal(sizeType)));
+ (orientation=="VERTICAL")?"Qt.TTQSizePolicy.SizeType.Minimum":("Qt.TTQSizePolicy.SizeType."+toPascal(sizeType)),
+ (orientation!="VERTICAL")?"Qt.TTQSizePolicy.SizeType.Minimum":("Qt.TTQSizePolicy.SizeType."+toPascal(sizeType)));
}
int layoutcnt=1;
@@ -600,11 +600,11 @@ namespace QtSharp {
parent=obj.GetAttribute("uicsharp_parent");
switch (obj.Name) {
- case "vbox": writer.WriteLine("\t\t"+(privateLayout?"TQVBoxLayout ":"")+name+"= new TQVBoxLayout("+
+ case "vbox": writer.WriteLine("\t\t"+(privateLayout?"TTQVBoxLayout ":"")+name+"= new TTQVBoxLayout("+
((parent==null)?"":parent)+");");
setupLayout(name,obj);
return obj;
- case "hbox": writer.WriteLine("\t\t"+(privateLayout?"TQHBoxLayout ":"")+name+"= new TQHBoxLayout("+
+ case "hbox": writer.WriteLine("\t\t"+(privateLayout?"TTQHBoxLayout ":"")+name+"= new TTQHBoxLayout("+
((parent==null)?"":parent)+");");
setupLayout(name,obj);
return obj;
@@ -647,7 +647,7 @@ namespace QtSharp {
rows=(tmprows<rows)?rows:tmprows;
}
}
- writer.WriteLine("\t\t"+ (privateLayout?"TQGridLayout ":"")+name +"= new TQGridLayout ("+
+ writer.WriteLine("\t\t"+ (privateLayout?"TTQGridLayout ":"")+name +"= new TTQGridLayout ("+
((parent==null)?"":(parent+", "))+rows+", "+cols+");");
setupLayout(name,obj);
return obj;
@@ -696,7 +696,7 @@ namespace QtSharp {
private void widgetType(XmlElement obj, ref String typename, ref XmlElement subcontainer, bool write)
{
typename=obj.GetAttribute("class");
- if ((typename!="TQGroupBox") && (typename!="ButtonGroup")) return;
+ if ((typename!="TTQGroupBox") && (typename!="ButtonGroup")) return;
foreach (XmlNode node in obj.ChildNodes) {
if (elementType(node as XmlElement)==ElementType.LayoutType) {
XmlElement el =node as XmlElement;
@@ -708,17 +708,17 @@ namespace QtSharp {
el.SetAttribute("uicsharp_alignment","(int)Qt.AlignmentFlags.AlignTop");
switch (el.Name) {
- case "vbox": typename="TQGroupBox";
+ case "vbox": typename="TTQGroupBox";
if (write)
- writer.WriteLine("\t\t TQVBoxLayout "+el.GetAttribute("uicsharp_name")+";");
+ writer.WriteLine("\t\t TTQVBoxLayout "+el.GetAttribute("uicsharp_name")+";");
return;
- case "hbox": typename="TQGroupBox";
+ case "hbox": typename="TTQGroupBox";
if (write)
- writer.WriteLine("\t\t TQHBoxLayout "+el.GetAttribute("uicsharp_name")+";");
+ writer.WriteLine("\t\t TTQHBoxLayout "+el.GetAttribute("uicsharp_name")+";");
return;
- case "grid": typename="TQGroupBox";
+ case "grid": typename="TTQGroupBox";
if (write)
- writer.WriteLine("\t\t TQGridLayout "+el.GetAttribute("uicsharp_name")+";");
+ writer.WriteLine("\t\t TTQGridLayout "+el.GetAttribute("uicsharp_name")+";");
return;
@@ -769,7 +769,7 @@ namespace QtSharp {
switch (value.Name) {
case "string" : if (prop.GetAttribute("name")!="accel") sc += "\""+stringify(value.InnerText)+"\"";
- else sc+="new TQKeySequence(\""+stringify(value.InnerText)+"\")";
+ else sc+="new TTQKeySequence(\""+stringify(value.InnerText)+"\")";
break;
case "cstring" : sc += value.InnerText;
break;
@@ -789,9 +789,9 @@ namespace QtSharp {
}
}
if ((varName=="this") && (methodName=="SetGeometry"))
- sc = "Resize ((new TQSize("+rw+", "+rh+")).ExpandedTo(SizeHint())";
+ sc = "Resize ((new TTQSize("+rw+", "+rh+")).ExpandedTo(SizeHint())";
else
- sc += "new TQRect("+rx+", "+ry+", "+rw+", "+rh+")";
+ sc += "new TTQRect("+rx+", "+ry+", "+rw+", "+rh+")";
break;
case "enum" :
@@ -810,12 +810,12 @@ namespace QtSharp {
}
break;
- case "iconset" : sc += "new TQIconSet("+value.InnerText+")";
+ case "iconset" : sc += "new TTQIconSet("+value.InnerText+")";
break;
case "bool" : sc += value.InnerText;
break;
case "font": String fvn=varName+"_Font";
- sc="\t\tQFont "+fvn+" = ("+varName+".Font());\n";
+ sc="\t\tTQFont "+fvn+" = ("+varName+".Font());\n";
foreach(XmlNode fn in value.ChildNodes) {
XmlElement fe=fn as XmlElement;
switch (fe.Name) {
@@ -923,7 +923,7 @@ namespace QtSharp {
{
writer.WriteLine("\tpublic static void Main (String[] args)\n"+
"\t{\n"+
- "\t\tQApplication app = new TQApplication (args);\n"+
+ "\t\tTQApplication app = new TTQApplication (args);\n"+
"\t\t"+className+" test = new "+className+" (null,\"\");\n"+
"\t\tapp.SetMainWidget (test);\n"+
"\t\ttest.Show ();\n"+