MSEide MSEgui first step: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: MSEide MSEgui first step
| Old | New | Line | |
|---|---|---|---|
| 1 | + | **My first mse program.** | |
| 2 | + | ||
| 3 | + | This introductory article for beginners. It contains step by step instructions to create the first program. | |
| 4 | + | ||
| 5 | + | Naturally, the software MSEide + MSEgui should already be installed. | |
| 6 | + | ||
| 7 | + | Start MSEide. | |
| 8 | + | ||
| 9 | + | The screen should get a window similar to the following: | |
| 10 | + | ||
| 11 | + | <figure> | |
| 12 | + | <img src="mseide_132.png" title="mseide_132.png" /> | |
| 13 | + | <figcaption>mseide_132.png</figcaption> | |
| 14 | + | </figure> | |
| 15 | + | ||
| 16 | + | Let's create a new project. | |
| 17 | + | ||
| 18 | + | Project menu (Project) - New (New) - From template (From Template). | |
| 19 | + | ||
| 20 | + | On the screen you get the following: | |
| 21 | + | ||
| 22 | + | <figure> | |
| 23 | + | <img src="mseide_142.png" title="mseide_142.png" /> | |
| 24 | + | <figcaption>mseide_142.png</figcaption> | |
| 25 | + | </figure> | |
| 26 | + | ||
| 27 | + | At this point MSEide prompts you to select a template file for the new project. | |
| 28 | + | ||
| 29 | + | We can use or default.prj or default_all_langs.prj. | |
| 30 | + | ||
| 31 | + | Template default.prj has a smaller executable file, default_all_langs.prj will connect automatically language constants, and dialogs (eg, file open dialog), windows maintenance... | |
| 32 | + | ||
| 33 | + | For this first program we do not have any dialog and service windows, so it is sufficient template default.prj. | |
| 34 | + | ||
| 35 | + | Select and press Ok. | |
| 36 | + | ||
| 37 | + | Click new. Cat-g (New dir) to create a directory. | |
| 38 | + | ||
| 39 | + | In the dialog box that appears, type "hellodemo" and click Ok. | |
| 40 | + | ||
| 41 | + | In the second field from the bottom of the window New Project (New Project), enter "hello". | |
| 42 | + | ||
| 43 | + | Prj extension will be added automatically. | |
| 44 | + | ||
| 45 | + | Now click Ok: | |
| 46 | + | ||
| 47 | + | <figure> | |
| 48 | + | <img src="mseide_152.png" title="mseide_152.png" /> | |
| 49 | + | <figcaption>mseide_152.png</figcaption> | |
| 50 | + | </figure> | |
| 51 | + | ||
| 52 | + | You have created your first project ! | |
| 53 | + | ||
| 54 | + | You should have at least four windows : | |
| 55 | + | ||
| 56 | + | \- 'MSEide (hello.prj)' - 'Component Palette (Component palette)' - 'Messages' - 'Source Code (Source, Messages) (Ctrl + F1) 'and' * mainfo '. | |
| 57 | + | ||
| 58 | + | Click on the box '* mainfo' (the smallest). | |
| 59 | + | ||
| 60 | + | Now you've got another important window =\> 'Object Inspector mainfo (Object inspector mainfo)'. | |
| 61 | + | ||
| 62 | + | For added convenience, grab the mouse box '* mainfo' for any angle and a little stretch. | |
| 63 | + | ||
| 64 | + | You will get something like this: | |
| 65 | + | ||
| 66 | + | <figure> | |
| 67 | + | <img src="mseide_162.png" title="mseide_162.png" /> | |
| 68 | + | <figcaption>mseide_162.png</figcaption> | |
| 69 | + | </figure> | |
| 70 | + | ||
| 71 | + | This is the main form of your project - its main window. | |
| 72 | + | ||
| 73 | + | On it you will put the necessary visual or non-visual components. | |
| 74 | + | ||
| 75 | + | Take components needed from the ('Palette components (Component palette)'): | |
| 76 | + | ||
| 77 | + | <figure> | |
| 78 | + | <img src="mseide_172.png" title="mseide_172.png" /> | |
| 79 | + | <figcaption>mseide_172.png</figcaption> | |
| 80 | + | </figure> | |
| 81 | + | ||
| 82 | + | The components are located on multiple pages. | |
| 83 | + | ||
| 84 | + | To switch between pages click on tabs at the top of the window. | |
| 85 | + | ||
| 86 | + | If you hold for a while the mouse pointer over a component, you will be prompted with the class (type) of this component. | |
| 87 | + | ||
| 88 | + | Now get component Widget tbutton and once click on it | |
| 89 | + | ||
| 90 | + | Now click on the main form of your project. Component appeared on the form. | |
| 91 | + | ||
| 92 | + | Place the mouse over the component. | |
| 93 | + | ||
| 94 | + | Now press the left mouse button and hold, move it to the side. | |
| 95 | + | ||
| 96 | + | Release the mouse button. Thus it is possible to move the component form. | |
| 97 | + | ||
| 98 | + | To change the size, perform the same steps with the black squares arranged around the perimeter of the component. | |
| 99 | + | ||
| 100 | + | Place the component in the right top of the form: | |
| 101 | + | ||
| 102 | + | <figure> | |
| 103 | + | <img src="mseide_182.png" title="mseide_182.png" /> | |
| 104 | + | <figcaption>mseide_182.png</figcaption> | |
| 105 | + | </figure> | |
| 106 | + | ||
| 107 | + | Go to the ('The object inspector mainfo (Object inspector mainfo)'). | |
| 108 | + | ||
| 109 | + | In the drop-down list, select (if there is not already selected) tbutton1 (tbutton). | |
| 110 | + | ||
| 111 | + | Below in the box to the right of the field caption, type the - button. | |
| 112 | + | ||
| 113 | + | Now you have set the value of the caption in the 'button: | |
| 114 | + | ||
| 115 | + | <figure> | |
| 116 | + | <img src="mseide_192.png" title="mseide_192.png" /> | |
| 117 | + | <figcaption>mseide_192.png</figcaption> | |
| 118 | + | </figure> | |
| 119 | + | ||
| 120 | + | Get the component type tlabel and place it on the left of our first button. | |
| 121 | + | ||
| 122 | + | Go to the Inspector window and select the object tbutton1 (tbutton) and | |
| 123 | + | ||
| 124 | + | set the value of a field in onexecute 'pressed' and press the Enter key on the keyboard. | |
| 125 | + | ||
| 126 | + | In the description of the class will be added the setnewaction method, | |
| 127 | + | ||
| 128 | + | and in the text of the module will be an empty implementation of this method. | |
| 129 | + | ||
| 130 | + | This method (procedure) will be called when the button is pressed. | |
| 131 | + | ||
| 132 | + | Go to the editor ('messages, source code (Source, Messages) (Ctrl + F1)') and edit the procedure pressed: | |
| 133 | + | ||
| 134 | + | ` procedure tmainfo.pressed(const sender:TObject);`\ | |
| 135 | + | ` begin`\ | |
| 136 | + | ` tlabel1.caption:='Hello World!';`\ | |
| 137 | + | ` end;` | |
| 138 | + | ||
| 139 | + | Back in the form with a second button, write 'output' and in the procedure body onexecute, | |
| 140 | + | ||
| 141 | + | called by pressing the (procedure name as you want), register one line: | |
| 142 | + | ||
| 143 | + | ` application.terminated:=true;` | |
| 144 | + | ||
| 145 | + | Run one of three ways: | |
| 146 | + | ||
| 147 | + | \- By clicking on the green triangle in the main window; | |
| 148 | + | ||
| 149 | + | \- Pressing F9; | |
| 150 | + | ||
| 151 | + | \- In menu (Target) - Continue to start (Continue) | |
| 152 | + | ||
| 153 | + | <figure> | |
| 154 | + | <img src="mseide_202.png" title="mseide_202.png" /> | |
| 155 | + | <figcaption>mseide_202.png</figcaption> | |
| 156 | + | </figure> | |
| 157 | + | ||
| 158 | + | This wiki was greatly inspired by web page of Alexei Yu Ulasevich (STAKANOV) =\> <http://freepascal.ru/article/mse> | |
| 159 | + | ||
| 160 | + | --- | |
| 161 | + | *From the Free Pascal wiki, page "MSEide MSEgui first step", as it stood on 2020-09-01 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* | |
| 162 | + | Category: MSEide+MSEgui | |
| 163 | + | Category: Tutorials |
