creating_20a_20dialogue_20box_20from_20a_20resource
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| creating_20a_20dialogue_20box_20from_20a_20resource [2018/03/31 13:19] – external edit 127.0.0.1 | creating_20a_20dialogue_20box_20from_20a_20resource [2024/01/05 00:22] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| =====Creating a dialogue box from a resource===== | =====Creating a dialogue box from a resource===== | ||
| - | //by Richard Russell, May 2006, revised April 2012//\\ \\ The normal method of creating a dialogue box in BBC BASIC for Windows is to call the procedures in the **WINLIB2** library:\\ | + | //by Richard Russell, May 2006, revised April 2012//\\ \\ The normal method of creating a dialogue box in BBC BASIC for Windows is to call the procedures in the **WINLIB2** library: |
| * PROC_pushbutton | * PROC_pushbutton | ||
| Line 12: | Line 12: | ||
| * PROC_dlgitem | * PROC_dlgitem | ||
| * PROC_dlgctrl | * PROC_dlgctrl | ||
| - | \\ | + | |
| + | However there may be circumstances when the dialogue box has already been designed and its template is contained as a // | ||
| + | |||
| + | <code bb4w> | ||
| INSTALL @lib$+" | INSTALL @lib$+" | ||
| Line 31: | Line 34: | ||
| dlg%?19 OR= &10 : REM Add WS_VISIBLE style | dlg%?19 OR= &10 : REM Add WS_VISIBLE style | ||
| PROC_showdialog(dlg%) | PROC_showdialog(dlg%) | ||
| - | Naturally this code will only run within the **BB4W IDE**, because if compiled to an executable file the dialogue box resource data will not be present.\\ \\ To load the dialogue box resource data from a different file (for example a DLL) then replace the call to " | + | </ |
| + | |||
| + | Naturally this code will only run within the **BB4W IDE**, because if compiled to an executable file the dialogue box resource data will not be present.\\ \\ To load the dialogue box resource data from a different file (for example a DLL) then replace the call to " | ||
| + | |||
| + | <code bb4w> | ||
| SYS " | SYS " | ||
| + | </ | ||
| + | |||
| You can embed one or more resources in your own compiled executable as follows: | You can embed one or more resources in your own compiled executable as follows: | ||
| Line 38: | Line 47: | ||
| - Compile the resource from a **.RC** file to a **.RES** file using a Resource Compiler. | - Compile the resource from a **.RC** file to a **.RES** file using a Resource Compiler. | ||
| - Specify that the resource should be embedded in your program using **REM!Resource**. | - Specify that the resource should be embedded in your program using **REM!Resource**. | ||
| - | \\ | + | |
| + | To enable you to develop and test your program in the BB4W IDE you can initially create a ' | ||
| + | |||
| + | <code bb4w> | ||
| REM!Exefile @dir$+" | REM!Exefile @dir$+" | ||
| REM!Resource @dir$+" | REM!Resource @dir$+" | ||
| - | Then you can access the resource from the ' | + | </ |
| + | |||
| + | Then you can access the resource from the ' | ||
| + | |||
| + | <code bb4w> | ||
| SYS " | SYS " | ||
| + | </ | ||
| + | |||
| When you eventually compile your program, containing the resources in its EXE file, this will still work. | When you eventually compile your program, containing the resources in its EXE file, this will still work. | ||
creating_20a_20dialogue_20box_20from_20a_20resource.1522502352.txt.gz · Last modified: 2024/01/05 00:18 (external edit)