diff options
Diffstat (limited to 'doc/html/designer-manual-4.html')
-rw-r--r-- | doc/html/designer-manual-4.html | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/doc/html/designer-manual-4.html b/doc/html/designer-manual-4.html index b684187d3..da13d9d8b 100644 --- a/doc/html/designer-manual-4.html +++ b/doc/html/designer-manual-4.html @@ -58,8 +58,8 @@ body { background: #ffffff; color: black; } <p>We can use one of TQt's static dialogs to get the user to choose a color, but we need our own dialog to get them to give it a name. We'll create that dialog now.</p> <p>Click <b>File|New</b> to invoke the <em>New File</em> dialog, then click "Dialog", then click <b>OK</b>. Drag a corner of the new form to make it a lot smaller. Change the form's name (in the <a href="designer-manual-3.html#using-the-property-editor-sidebar">Property Editor</a>) to "ColorNameForm", and change its caption to "Color Tool -- Color Name". Click <b>File|Save</b>, then click <b>Save</b> to save it.</p> <p>We'll now add some widgets to the dialog. Don't worry about precise positioning or sizing; we'll get <em>TQt Designer</em> to lay the form out perfectly for us shortly.</p> -<p>We need to create a <a href="ntqlabel.html">TQLabel</a> that will show the color the user has chosen. Click the TextLabel tool in the Toolbox, then click on the left hand side of the form. Change the label's <em>name</em> property to "colorLabel", and delete the text in the <em>text</em> property. Click the <em>pixmap</em> property's ellipsis button and choose the "editraise.png" image. Change the <em>minimumSize</em> property's <em>width</em> sub-property to 80, and set the <em>scaledContents</em> property to True.</p> -<p>Click the TextLabel tool again, then click to the right of the colorLabel, towards the top of the form. Change the <em>text</em> property to "&Name". Note that the ampersand is displayed; this is because a <a href="ntqlabel.html">TQLabel</a> cannot accept focus and we haven't specified a focus widget ("buddy") yet.</p> +<p>We need to create a <a href="tqlabel.html">TQLabel</a> that will show the color the user has chosen. Click the TextLabel tool in the Toolbox, then click on the left hand side of the form. Change the label's <em>name</em> property to "colorLabel", and delete the text in the <em>text</em> property. Click the <em>pixmap</em> property's ellipsis button and choose the "editraise.png" image. Change the <em>minimumSize</em> property's <em>width</em> sub-property to 80, and set the <em>scaledContents</em> property to True.</p> +<p>Click the TextLabel tool again, then click to the right of the colorLabel, towards the top of the form. Change the <em>text</em> property to "&Name". Note that the ampersand is displayed; this is because a <a href="tqlabel.html">TQLabel</a> cannot accept focus and we haven't specified a focus widget ("buddy") yet.</p> <p>Click the LineEdit tool, then click to the right of the "Name" label, again towards the top of the form. Change the <em>name</em> property to "colorLineEdit".</p> <p>Click on the "Name" label and change its <em>buddy</em> property to "colorLineEdit". The ampersand has now disappeared and <b>Alt+N</b> will set the focus in the colorLineEdit.</p> <p>Click the PushButton tool, then click below the "colorLabel". Change the button's <em>name</em> property to "okPushButton", its <em>text</em> property to "OK", and its <em>default</em> property to True.</p> @@ -151,10 +151,10 @@ body { background: #ffffff; color: black; } <h4><a name="1-3"></a>Using the Dialog</h4> <p>The ColorNameForm dialog will be called from the main form. The caller will firstly call one of TQt's static "choose a color" dialogs, and if the user chooses a color, will then invoke our custom dialog. Since we're going to use a "choose a color" dialog we will need the appropriate header file. We'll also be accessing the dialog's colorLabel (to set it to the chosen color), and the dialog's line edit (to retrieve the color name), so we'll need appropriate headers for these too.</p> <p>Click "MainForm" in the Project Overview window so that Object Explorer shows the main form's objects.</p> -<p>Click Object Explorer's Members tab. Right click "Includes (in Implementation)", then click <b>Edit</b> to invoke the <em>Edit Includes (in Implementation)</em> dialog. Click <b>Add</b> then enter "tqcolordialog.h". Click <b>Add</b> again, and enter "ntqlabel.h". Similarly add "ntqlineedit.h". We also need to include the header for the form we've just created, so add "colornameform.h", and since it is our last entry press <b>Enter</b>, then click <b>Close</b>.</p> +<p>Click Object Explorer's Members tab. Right click "Includes (in Implementation)", then click <b>Edit</b> to invoke the <em>Edit Includes (in Implementation)</em> dialog. Click <b>Add</b> then enter "tqcolordialog.h". Click <b>Add</b> again, and enter "tqlabel.h". Similarly add "ntqlineedit.h". We also need to include the header for the form we've just created, so add "colornameform.h", and since it is our last entry press <b>Enter</b>, then click <b>Close</b>.</p> <p>You should now have added the following declarations to your includes (in implementation):</p> <ul><li><p>"tqcolordialog.h"</p> -<li><p>"ntqlabel.h"</p> +<li><p>"tqlabel.h"</p> <li><p>"ntqlineedit.h"</p> <li><p>"colornameform.h"</p> </ul><p>Now we're ready to enter the <tt>editAdd()</tt> slot's code. Click "mainform.ui.h" in the Project Overview to invoke the code editor.</p> @@ -483,7 +483,7 @@ body { background: #ffffff; color: black; } </ul><p>Includes (in Implementation):</p> <ul><li><p>"optionsform.h"</p> <li><p>"ntqlineedit.h"</p> -<li><p>"ntqlabel.h"</p> +<li><p>"tqlabel.h"</p> <li><p>"tqclipboard.h"</p> <li><p>"ntqmessagebox.h"</p> <li><p>"tqstatusbar.h"</p> |