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