Explorar o código

0. Finished laying out other tabs.
1. Changed the ProjectOptions caller in mainform.ui.h from using stack memory to using free store for the projectoptions variable. The old way was apparently causing a stack overflow once I had all the controls laid out.


git-svn-id: file:///var/svn/tigccpp/trunk@501 9552661e-59e3-4036-b4f2-dbe53926924f

joeyadams %!s(int64=18) %!d(string=hai) anos
pai
achega
651fc694c4
Modificáronse 3 ficheiros con 556 adicións e 52 borrados
  1. 5 2
      ktigcc/mainform.ui.h
  2. 538 50
      ktigcc/projectoptions.ui
  3. 13 0
      ktigcc/projectoptions.ui.h

+ 5 - 2
ktigcc/mainform.ui.h

@@ -1553,8 +1553,11 @@ void MainForm::projectProgramOutput()
 
 void MainForm::projectOptions()
 {
-  ProjectOptions projectoptions(this);
-  projectoptions.exec();
+  //You CANNOT create projectoptions in the stack.  I tried it, and it causes a crash when you try to close the dialog.
+  //PS: Last time I checked, sizeof(ProjectOptions)==508
+  ProjectOptions *projectoptions=new ProjectOptions(this);
+  projectoptions->exec();
+  delete(projectoptions);
 }
 
 void MainForm::debugRun()

+ 538 - 50
ktigcc/projectoptions.ui

@@ -644,6 +644,14 @@
                                 <property name="name">
                                     <cstring>FargoProgram</cstring>
                                 </property>
+                                <property name="sizePolicy">
+                                    <sizepolicy>
+                                        <hsizetype>5</hsizetype>
+                                        <vsizetype>1</vsizetype>
+                                        <horstretch>0</horstretch>
+                                        <verstretch>0</verstretch>
+                                    </sizepolicy>
+                                </property>
                                 <property name="minimumSize">
                                     <size>
                                         <width>0</width>
@@ -919,22 +927,402 @@
                 <attribute name="title">
                     <string>&amp;Linking</string>
                 </attribute>
-                <widget class="QButtonGroup">
+                <vbox>
                     <property name="name">
-                        <cstring>buttonGroup3</cstring>
-                    </property>
-                    <property name="geometry">
-                        <rect>
-                            <x>20</x>
-                            <y>10</y>
-                            <width>340</width>
-                            <height>210</height>
-                        </rect>
-                    </property>
-                    <property name="title">
-                        <string>Optimization</string>
+                        <cstring>unnamed</cstring>
                     </property>
-                </widget>
+                    <widget class="QButtonGroup">
+                        <property name="name">
+                            <cstring>buttonGroup3</cstring>
+                        </property>
+                        <property name="title">
+                            <string>Optimi&amp;zation</string>
+                        </property>
+                        <vbox>
+                            <property name="name">
+                                <cstring>unnamed</cstring>
+                            </property>
+                            <widget class="QLayoutWidget">
+                                <property name="name">
+                                    <cstring>layout14</cstring>
+                                </property>
+                                <hbox>
+                                    <property name="name">
+                                        <cstring>unnamed</cstring>
+                                    </property>
+                                    <widget class="QLayoutWidget">
+                                        <property name="name">
+                                            <cstring>layout12</cstring>
+                                        </property>
+                                        <vbox>
+                                            <property name="name">
+                                                <cstring>unnamed</cstring>
+                                            </property>
+                                            <widget class="QCheckBox">
+                                                <property name="name">
+                                                    <cstring>NOPs</cstring>
+                                                </property>
+                                                <property name="sizePolicy">
+                                                    <sizepolicy>
+                                                        <hsizetype>1</hsizetype>
+                                                        <vsizetype>1</vsizetype>
+                                                        <horstretch>0</horstretch>
+                                                        <verstretch>0</verstretch>
+                                                    </sizepolicy>
+                                                </property>
+                                                <property name="text">
+                                                    <string>NOP&amp;s</string>
+                                                </property>
+                                                <property name="accel">
+                                                    <string>Alt+S</string>
+                                                </property>
+                                            </widget>
+                                            <widget class="QCheckBox">
+                                                <property name="name">
+                                                    <cstring>ReturnSequences</cstring>
+                                                </property>
+                                                <property name="sizePolicy">
+                                                    <sizepolicy>
+                                                        <hsizetype>1</hsizetype>
+                                                        <vsizetype>1</vsizetype>
+                                                        <horstretch>0</horstretch>
+                                                        <verstretch>0</verstretch>
+                                                    </sizepolicy>
+                                                </property>
+                                                <property name="text">
+                                                    <string>&amp;Return Sequences</string>
+                                                </property>
+                                                <property name="accel">
+                                                    <string>Alt+R</string>
+                                                </property>
+                                            </widget>
+                                            <widget class="QCheckBox">
+                                                <property name="name">
+                                                    <cstring>Branches</cstring>
+                                                </property>
+                                                <property name="sizePolicy">
+                                                    <sizepolicy>
+                                                        <hsizetype>1</hsizetype>
+                                                        <vsizetype>1</vsizetype>
+                                                        <horstretch>0</horstretch>
+                                                        <verstretch>0</verstretch>
+                                                    </sizepolicy>
+                                                </property>
+                                                <property name="text">
+                                                    <string>&amp;Branches</string>
+                                                </property>
+                                                <property name="accel">
+                                                    <string>Alt+B</string>
+                                                </property>
+                                            </widget>
+                                        </vbox>
+                                    </widget>
+                                    <widget class="QLayoutWidget">
+                                        <property name="name">
+                                            <cstring>layout13</cstring>
+                                        </property>
+                                        <vbox>
+                                            <property name="name">
+                                                <cstring>unnamed</cstring>
+                                            </property>
+                                            <widget class="QCheckBox">
+                                                <property name="name">
+                                                    <cstring>MoveLoadPushInstructions</cstring>
+                                                </property>
+                                                <property name="sizePolicy">
+                                                    <sizepolicy>
+                                                        <hsizetype>1</hsizetype>
+                                                        <vsizetype>1</vsizetype>
+                                                        <horstretch>0</horstretch>
+                                                        <verstretch>0</verstretch>
+                                                    </sizepolicy>
+                                                </property>
+                                                <property name="text">
+                                                    <string>Move/Load/Pus&amp;h Instructions</string>
+                                                </property>
+                                                <property name="accel">
+                                                    <string>Alt+H</string>
+                                                </property>
+                                            </widget>
+                                            <widget class="QCheckBox">
+                                                <property name="name">
+                                                    <cstring>TestCompareInstructions</cstring>
+                                                </property>
+                                                <property name="sizePolicy">
+                                                    <sizepolicy>
+                                                        <hsizetype>1</hsizetype>
+                                                        <vsizetype>1</vsizetype>
+                                                        <horstretch>0</horstretch>
+                                                        <verstretch>0</verstretch>
+                                                    </sizepolicy>
+                                                </property>
+                                                <property name="text">
+                                                    <string>&amp;Test/Compare Instructions</string>
+                                                </property>
+                                                <property name="accel">
+                                                    <string>Alt+T</string>
+                                                </property>
+                                            </widget>
+                                            <widget class="QCheckBox">
+                                                <property name="name">
+                                                    <cstring>CalculationInstructions</cstring>
+                                                </property>
+                                                <property name="sizePolicy">
+                                                    <sizepolicy>
+                                                        <hsizetype>1</hsizetype>
+                                                        <vsizetype>1</vsizetype>
+                                                        <horstretch>0</horstretch>
+                                                        <verstretch>0</verstretch>
+                                                    </sizepolicy>
+                                                </property>
+                                                <property name="text">
+                                                    <string>C&amp;alculation Instructions</string>
+                                                </property>
+                                                <property name="accel">
+                                                    <string>Alt+A</string>
+                                                </property>
+                                            </widget>
+                                        </vbox>
+                                    </widget>
+                                </hbox>
+                            </widget>
+                            <widget class="QLayoutWidget">
+                                <property name="name">
+                                    <cstring>layout18</cstring>
+                                </property>
+                                <hbox>
+                                    <property name="name">
+                                        <cstring>unnamed</cstring>
+                                    </property>
+                                    <spacer>
+                                        <property name="name">
+                                            <cstring>spacer10_3</cstring>
+                                        </property>
+                                        <property name="orientation">
+                                            <enum>Horizontal</enum>
+                                        </property>
+                                        <property name="sizeType">
+                                            <enum>Preferred</enum>
+                                        </property>
+                                        <property name="sizeHint">
+                                            <size>
+                                                <width>10</width>
+                                                <height>20</height>
+                                            </size>
+                                        </property>
+                                    </spacer>
+                                    <widget class="QLayoutWidget">
+                                        <property name="name">
+                                            <cstring>layout16</cstring>
+                                        </property>
+                                        <vbox>
+                                            <property name="name">
+                                                <cstring>unnamed</cstring>
+                                            </property>
+                                            <widget class="QCheckBox">
+                                                <property name="name">
+                                                    <cstring>RemoveUnusedSections</cstring>
+                                                </property>
+                                                <property name="enabled">
+                                                    <bool>true</bool>
+                                                </property>
+                                                <property name="sizePolicy">
+                                                    <sizepolicy>
+                                                        <hsizetype>1</hsizetype>
+                                                        <vsizetype>1</vsizetype>
+                                                        <horstretch>0</horstretch>
+                                                        <verstretch>0</verstretch>
+                                                    </sizepolicy>
+                                                </property>
+                                                <property name="text">
+                                                    <string>Remove &amp;unused sections</string>
+                                                </property>
+                                                <property name="accel">
+                                                    <string>Alt+U</string>
+                                                </property>
+                                            </widget>
+                                            <widget class="QCheckBox">
+                                                <property name="name">
+                                                    <cstring>ReorderSections</cstring>
+                                                </property>
+                                                <property name="sizePolicy">
+                                                    <sizepolicy>
+                                                        <hsizetype>1</hsizetype>
+                                                        <vsizetype>1</vsizetype>
+                                                        <horstretch>0</horstretch>
+                                                        <verstretch>0</verstretch>
+                                                    </sizepolicy>
+                                                </property>
+                                                <property name="text">
+                                                    <string>R&amp;eorder sections</string>
+                                                </property>
+                                                <property name="accel">
+                                                    <string>Alt+E</string>
+                                                </property>
+                                            </widget>
+                                        </vbox>
+                                    </widget>
+                                    <spacer>
+                                        <property name="name">
+                                            <cstring>spacer15_2</cstring>
+                                        </property>
+                                        <property name="orientation">
+                                            <enum>Horizontal</enum>
+                                        </property>
+                                        <property name="sizeType">
+                                            <enum>Preferred</enum>
+                                        </property>
+                                        <property name="sizeHint">
+                                            <size>
+                                                <width>10</width>
+                                                <height>20</height>
+                                            </size>
+                                        </property>
+                                    </spacer>
+                                    <widget class="QLayoutWidget">
+                                        <property name="name">
+                                            <cstring>layout17</cstring>
+                                        </property>
+                                        <vbox>
+                                            <property name="name">
+                                                <cstring>unnamed</cstring>
+                                            </property>
+                                            <widget class="QCheckBox">
+                                                <property name="name">
+                                                    <cstring>CutUnusedRanges</cstring>
+                                                </property>
+                                                <property name="sizePolicy">
+                                                    <sizepolicy>
+                                                        <hsizetype>1</hsizetype>
+                                                        <vsizetype>1</vsizetype>
+                                                        <horstretch>0</horstretch>
+                                                        <verstretch>0</verstretch>
+                                                    </sizepolicy>
+                                                </property>
+                                                <property name="text">
+                                                    <string>Cut unuse&amp;d ranges</string>
+                                                </property>
+                                                <property name="accel">
+                                                    <string>Alt+D</string>
+                                                </property>
+                                            </widget>
+                                            <widget class="QCheckBox">
+                                                <property name="name">
+                                                    <cstring>MergeConstants</cstring>
+                                                </property>
+                                                <property name="sizePolicy">
+                                                    <sizepolicy>
+                                                        <hsizetype>1</hsizetype>
+                                                        <vsizetype>1</vsizetype>
+                                                        <horstretch>0</horstretch>
+                                                        <verstretch>0</verstretch>
+                                                    </sizepolicy>
+                                                </property>
+                                                <property name="text">
+                                                    <string>Mer&amp;ge Constants</string>
+                                                </property>
+                                                <property name="accel">
+                                                    <string>Alt+G</string>
+                                                </property>
+                                            </widget>
+                                        </vbox>
+                                    </widget>
+                                    <spacer>
+                                        <property name="name">
+                                            <cstring>spacer11_2</cstring>
+                                        </property>
+                                        <property name="orientation">
+                                            <enum>Horizontal</enum>
+                                        </property>
+                                        <property name="sizeType">
+                                            <enum>Preferred</enum>
+                                        </property>
+                                        <property name="sizeHint">
+                                            <size>
+                                                <width>10</width>
+                                                <height>20</height>
+                                            </size>
+                                        </property>
+                                    </spacer>
+                                </hbox>
+                            </widget>
+                        </vbox>
+                    </widget>
+                    <widget class="QCheckBox">
+                        <property name="name">
+                            <cstring>LinkAgainstStandardLibrary</cstring>
+                        </property>
+                        <property name="sizePolicy">
+                            <sizepolicy>
+                                <hsizetype>5</hsizetype>
+                                <vsizetype>1</vsizetype>
+                                <horstretch>0</horstretch>
+                                <verstretch>0</verstretch>
+                            </sizepolicy>
+                        </property>
+                        <property name="text">
+                            <string>Lin&amp;k against standard library (tigcc.a)</string>
+                        </property>
+                        <property name="accel">
+                            <string>Alt+K</string>
+                        </property>
+                    </widget>
+                    <widget class="QCheckBox">
+                        <property name="name">
+                            <cstring>InitializeBSSSection</cstring>
+                        </property>
+                        <property name="sizePolicy">
+                            <sizepolicy>
+                                <hsizetype>5</hsizetype>
+                                <vsizetype>1</vsizetype>
+                                <horstretch>0</horstretch>
+                                <verstretch>0</verstretch>
+                            </sizepolicy>
+                        </property>
+                        <property name="text">
+                            <string>&amp;Initialize BSS section</string>
+                        </property>
+                        <property name="accel">
+                            <string>Alt+I</string>
+                        </property>
+                    </widget>
+                    <widget class="QCheckBox">
+                        <property name="name">
+                            <cstring>OutputVariableImageWithoutWrapper</cstring>
+                        </property>
+                        <property name="sizePolicy">
+                            <sizepolicy>
+                                <hsizetype>5</hsizetype>
+                                <vsizetype>1</vsizetype>
+                                <horstretch>0</horstretch>
+                                <verstretch>0</verstretch>
+                            </sizepolicy>
+                        </property>
+                        <property name="text">
+                            <string>Output &amp;variable image without wrapper (binary mode)</string>
+                        </property>
+                        <property name="accel">
+                            <string>Alt+V</string>
+                        </property>
+                    </widget>
+                    <spacer>
+                        <property name="name">
+                            <cstring>spacer15</cstring>
+                        </property>
+                        <property name="orientation">
+                            <enum>Vertical</enum>
+                        </property>
+                        <property name="sizeType">
+                            <enum>Expanding</enum>
+                        </property>
+                        <property name="sizeHint">
+                            <size>
+                                <width>20</width>
+                                <height>30</height>
+                            </size>
+                        </property>
+                    </spacer>
+                </vbox>
             </widget>
             <widget class="QWidget">
                 <property name="name">
@@ -943,38 +1331,137 @@
                 <attribute name="title">
                     <string>&amp;Post-Build</string>
                 </attribute>
-                <widget class="QButtonGroup">
-                    <property name="name">
-                        <cstring>buttonGroup5</cstring>
-                    </property>
-                    <property name="geometry">
-                        <rect>
-                            <x>20</x>
-                            <y>120</y>
-                            <width>371</width>
-                            <height>91</height>
-                        </rect>
-                    </property>
-                    <property name="title">
-                        <string>Execution</string>
-                    </property>
-                </widget>
-                <widget class="QButtonGroup">
+                <vbox>
                     <property name="name">
-                        <cstring>buttonGroup4</cstring>
-                    </property>
-                    <property name="geometry">
-                        <rect>
-                            <x>18</x>
-                            <y>12</y>
-                            <width>371</width>
-                            <height>91</height>
-                        </rect>
-                    </property>
-                    <property name="title">
-                        <string>Post-Build</string>
+                        <cstring>unnamed</cstring>
                     </property>
-                </widget>
+                    <widget class="QButtonGroup">
+                        <property name="name">
+                            <cstring>buttonGroup4</cstring>
+                        </property>
+                        <property name="title">
+                            <string>Po&amp;st-Build Processing</string>
+                        </property>
+                        <vbox>
+                            <property name="name">
+                                <cstring>unnamed</cstring>
+                            </property>
+                            <widget class="QLayoutWidget">
+                                <property name="name">
+                                    <cstring>layout24</cstring>
+                                </property>
+                                <hbox>
+                                    <property name="name">
+                                        <cstring>unnamed</cstring>
+                                    </property>
+                                    <widget class="QLabel">
+                                        <property name="name">
+                                            <cstring>LCallAfterBuilding</cstring>
+                                        </property>
+                                        <property name="sizePolicy">
+                                            <sizepolicy>
+                                                <hsizetype>1</hsizetype>
+                                                <vsizetype>1</vsizetype>
+                                                <horstretch>0</horstretch>
+                                                <verstretch>0</verstretch>
+                                            </sizepolicy>
+                                        </property>
+                                        <property name="text">
+                                            <string>Call &lt;u&gt;a&lt;/u&gt;fter building:</string>
+                                        </property>
+                                        <property name="alignment">
+                                            <set>AlignVCenter</set>
+                                        </property>
+                                    </widget>
+                                    <spacer>
+                                        <property name="name">
+                                            <cstring>spacer16</cstring>
+                                        </property>
+                                        <property name="orientation">
+                                            <enum>Horizontal</enum>
+                                        </property>
+                                        <property name="sizeType">
+                                            <enum>Expanding</enum>
+                                        </property>
+                                        <property name="sizeHint">
+                                            <size>
+                                                <width>121</width>
+                                                <height>20</height>
+                                            </size>
+                                        </property>
+                                    </spacer>
+                                    <widget class="QPushButton">
+                                        <property name="name">
+                                            <cstring>Browse</cstring>
+                                        </property>
+                                        <property name="text">
+                                            <string>&amp;Browse...</string>
+                                        </property>
+                                        <property name="accel">
+                                            <string>Alt+B</string>
+                                        </property>
+                                    </widget>
+                                </hbox>
+                            </widget>
+                            <widget class="QLineEdit">
+                                <property name="name">
+                                    <cstring>CallAfterBuilding</cstring>
+                                </property>
+                            </widget>
+                        </vbox>
+                    </widget>
+                    <widget class="QButtonGroup">
+                        <property name="name">
+                            <cstring>buttonGroup5</cstring>
+                        </property>
+                        <property name="title">
+                            <string>&amp;Execution</string>
+                        </property>
+                        <hbox>
+                            <property name="name">
+                                <cstring>unnamed</cstring>
+                            </property>
+                            <widget class="QLabel">
+                                <property name="name">
+                                    <cstring>LParameters</cstring>
+                                </property>
+                                <property name="sizePolicy">
+                                    <sizepolicy>
+                                        <hsizetype>1</hsizetype>
+                                        <vsizetype>1</vsizetype>
+                                        <horstretch>0</horstretch>
+                                        <verstretch>0</verstretch>
+                                    </sizepolicy>
+                                </property>
+                                <property name="text">
+                                    <string>Pa&lt;u&gt;r&lt;/u&gt;ameters:</string>
+                                </property>
+                            </widget>
+                            <widget class="QLineEdit">
+                                <property name="name">
+                                    <cstring>Parameters</cstring>
+                                </property>
+                            </widget>
+                        </hbox>
+                    </widget>
+                    <spacer>
+                        <property name="name">
+                            <cstring>spacer17</cstring>
+                        </property>
+                        <property name="orientation">
+                            <enum>Vertical</enum>
+                        </property>
+                        <property name="sizeType">
+                            <enum>Expanding</enum>
+                        </property>
+                        <property name="sizeHint">
+                            <size>
+                                <width>41</width>
+                                <height>40</height>
+                            </size>
+                        </property>
+                    </spacer>
+                </vbox>
             </widget>
         </widget>
         <widget class="QLayoutWidget">
@@ -1075,6 +1562,12 @@
         <receiver>ProjectOptions</receiver>
         <slot>reject()</slot>
     </connection>
+    <connection>
+        <sender>buttonOk</sender>
+        <signal>clicked()</signal>
+        <receiver>ProjectOptions</receiver>
+        <slot>accept()</slot>
+    </connection>
     <connection>
         <sender>RegularProgram</sender>
         <signal>toggled(bool)</signal>
@@ -1117,12 +1610,6 @@
         <receiver>ProjectOptions</receiver>
         <slot>UpdateVisibilities()</slot>
     </connection>
-    <connection>
-        <sender>buttonOk</sender>
-        <signal>clicked()</signal>
-        <receiver>ProjectOptions</receiver>
-        <slot>accept()</slot>
-    </connection>
 </connections>
 <includes>
     <include location="local" impldecl="in implementation">projectoptions.ui.h</include>
@@ -1133,6 +1620,7 @@
     <slot>CompressProgramToggle()</slot>
     <slot>CheckOncalcNames()</slot>
     <slot>UpdateVisibilities()</slot>
+    <slot>ProgramOptionsFunc()</slot>
 </slots>
 <functions>
     <function access="private" specifier="non virtual">init()</function>

+ 13 - 0
ktigcc/projectoptions.ui.h

@@ -26,6 +26,8 @@ QAccel *AOncalcVariableName_2;
 QAccel *AGCCSwitches;
 QAccel *AAsSwitches;
 QAccel *AA68kSwitches;
+QAccel *ACallAfterBuilding;
+QAccel *AParameters;
 
 void ProjectOptions::init()
 {
@@ -36,6 +38,8 @@ void ProjectOptions::init()
   UnwrapLabel(LGCCSwitches);
   UnwrapLabel(LAsSwitches);
   UnwrapLabel(LA68kSwitches);
+  UnwrapLabel(LCallAfterBuilding);
+  UnwrapLabel(LParameters);
   //Toggle controls to match settings.
   //Tab: General
   OncalcVariableName_1->setText(settings.data_var);
@@ -91,6 +95,8 @@ void ProjectOptions::init()
   MakeAccelerator(AGCCSwitches,GCCSwitches,1,ALT+Key_G);
   MakeAccelerator(AAsSwitches,AsSwitches,1,ALT+Key_S);
   MakeAccelerator(AA68kSwitches,A68kSwitches,1,ALT+Key_A);
+  MakeAccelerator(ACallAfterBuilding,CallAfterBuilding,3,ALT+Key_A);
+  MakeAccelerator(AParameters,Parameters,3,ALT+Key_R);
   #undef MakeAccelerator
 }
 
@@ -101,6 +107,8 @@ void ProjectOptions::destroy()
   delete(AGCCSwitches);
   delete(AAsSwitches);
   delete(AA68kSwitches);
+  delete(ACallAfterBuilding);
+  delete(AParameters);
   if (result()!=QDialog::Accepted)
     return;
   //Save settings
@@ -206,3 +214,8 @@ void ProjectOptions::UpdateVisibilities()
   PO_TabWidget->setTabEnabled(PO_TabWidget->page(3),!functionarchive);
   
 }
+
+void ProjectOptions::ProgramOptionsFunc()
+{
+  
+}