Difference between revisions of "Wizard Scripting Commands"
(Added pics of pre-defined wizard pages) |
|||
Line 18: | Line 18: | ||
Add the "Intro" page. This is usually the first page to be displayed by the wizard and it only contains a static text explaining in a few words what this wizard will do. | Add the "Intro" page. This is usually the first page to be displayed by the wizard and it only contains a static text explaining in a few words what this wizard will do. | ||
+ | |||
+ | |||
+ | [[Image:Intro_panel.png]] | ||
+ | |||
{| border="1" cellpadding="3" cellspacing="0" style="border: 1px solid gray; border-collapse: collapse;" | {| border="1" cellpadding="3" cellspacing="0" style="border: 1px solid gray; border-collapse: collapse;" | ||
Line 32: | Line 36: | ||
It also contains a ''header guard'' text box which can be visible or not. Usually used when the file in question is a C/C++ header, in which case you might want to allow the user to customize the ''header guard'' word. Note that if this is visible it is also auto-updated to match the selected filename. The auto-update takes the filename part (no path), capitalizes it and replaces any non-character or non-digit to an underscore. | It also contains a ''header guard'' text box which can be visible or not. Usually used when the file in question is a C/C++ header, in which case you might want to allow the user to customize the ''header guard'' word. Note that if this is visible it is also auto-updated to match the selected filename. The auto-update takes the filename part (no path), capitalizes it and replaces any non-character or non-digit to an underscore. | ||
+ | |||
+ | |||
+ | [[Image:File_path_panel.png]] | ||
+ | |||
{| border="1" cellpadding="3" cellspacing="0" style="border: 1px solid gray; border-collapse: collapse;" | {| border="1" cellpadding="3" cellspacing="0" style="border: 1px solid gray; border-collapse: collapse;" | ||
Line 46: | Line 54: | ||
This page contains text boxes to set the project title, filename and base directory. | This page contains text boxes to set the project title, filename and base directory. | ||
+ | |||
+ | |||
+ | [[Image:Project_path_panel.png]] | ||
+ | |||
{| border="1" cellpadding="3" cellspacing="0" style="border: 1px solid gray; border-collapse: collapse;" | {| border="1" cellpadding="3" cellspacing="0" style="border: 1px solid gray; border-collapse: collapse;" | ||
Line 62: | Line 74: | ||
Finally, the build targets related settings can be either visible or not. If they 're visible, they allow the user to customize per-target the target's name, working directory and objects output (intermediate) directory. | Finally, the build targets related settings can be either visible or not. If they 're visible, they allow the user to customize per-target the target's name, working directory and objects output (intermediate) directory. | ||
+ | |||
+ | |||
+ | [[Image:Compiler_panel.png]] | ||
+ | |||
{| border="1" cellpadding="3" cellspacing="0" style="border: 1px solid gray; border-collapse: collapse;" | {| border="1" cellpadding="3" cellspacing="0" style="border: 1px solid gray; border-collapse: collapse;" | ||
Line 84: | Line 100: | ||
The compilers' list can contain all supported compilers or a script-defined list. It can also be selected whether compiler selection will be enabled or not. | The compilers' list can contain all supported compilers or a script-defined list. It can also be selected whether compiler selection will be enabled or not. | ||
+ | |||
[[Image:Build_target_panel.png]] | [[Image:Build_target_panel.png]] | ||
+ | |||
{| border="1" cellpadding="3" cellspacing="0" style="border: 1px solid gray; border-collapse: collapse;" | {| border="1" cellpadding="3" cellspacing="0" style="border: 1px solid gray; border-collapse: collapse;" | ||
Line 103: | Line 121: | ||
| allowCompilerChange || bool || If true, the user will be able to change the compiler selection. If false, the selection will be read-only. | | allowCompilerChange || bool || If true, the user will be able to change the compiler selection. If false, the selection will be read-only. | ||
|} | |} | ||
+ | |||
=== AddGenericSingleChoiceListPage(pageId, descr, choices, defChoice) === | === AddGenericSingleChoiceListPage(pageId, descr, choices, defChoice) === | ||
+ | Adds a page that contains a script-defined list and the user can select one single value from it. | ||
+ | |||
+ | |||
+ | [[Image:Generic_single_choice_list.png]] | ||
− | |||
{| border="1" cellpadding="3" cellspacing="0" style="border: 1px solid gray; border-collapse: collapse;" | {| border="1" cellpadding="3" cellspacing="0" style="border: 1px solid gray; border-collapse: collapse;" | ||
Line 123: | Line 145: | ||
=== AddGenericSelectPathPage(pageId, descr, label, defValue) === | === AddGenericSelectPathPage(pageId, descr, label, defValue) === | ||
+ | Adds a page that allows the user to select a folder from the filesystem. | ||
+ | |||
+ | |||
+ | [[Image:Generic_select_path.png]] | ||
− | |||
{| border="1" cellpadding="3" cellspacing="0" style="border: 1px solid gray; border-collapse: collapse;" | {| border="1" cellpadding="3" cellspacing="0" style="border: 1px solid gray; border-collapse: collapse;" |
Revision as of 08:52, 10 July 2006
In this page, all the wizards-related script commands are listed and explained.
Before we start, remember that in every wizard script there is a global variable defined named Wizard. This is the object that all the following commands are known under.
Adding wizard pages
The script writer creates a wizard by adding various pre-defined and/or custom pages to the wizard object. The order the pages are added define the order in which they will appear (almost).
The script has the chance to interfere with the wizards operation any time the user presses "Next" or "Back" on the wizard dialog. For more on this, please read Wizard Page Events.
NOTE: The following commands only make sense inside the BeginWizard() script function.
AddIntroPage(intro_msg)
Add the "Intro" page. This is usually the first page to be displayed by the wizard and it only contains a static text explaining in a few words what this wizard will do.
Parameter | Type | Description |
---|---|---|
intro_msg | wxString | The intro text |
AddFilePathPage(showHeaderGuard)
Add a page that allows for the selection of a file. This file might not exist. Usually used by wizards of type wizFiles for the selection of the output files.
It also contains a header guard text box which can be visible or not. Usually used when the file in question is a C/C++ header, in which case you might want to allow the user to customize the header guard word. Note that if this is visible it is also auto-updated to match the selected filename. The auto-update takes the filename part (no path), capitalizes it and replaces any non-character or non-digit to an underscore.
Parameter | Type | Description |
---|---|---|
showHeaderGuard | bool | If true, a header guard text box will be visible |
AddProjectPathPage()
Add a page that allows the user to customize the new project. Usually used by wizards of type wizProject.
This page contains text boxes to set the project title, filename and base directory.
Parameter | Type | Description |
---|---|---|
- | - | - |
AddCompilerPage(compilerID, validCompilerIDs, allowCompilerChange, allowConfigChange)
Perhaps the most used pre-defined wizard page. It contains a compiler selection list and a couple of well-known pre-defined build targets: Debug and Release.
The compilers' list can contain all supported compilers or a script-defined list. It can also be selected whether compiler selection will be enabled or not.
Finally, the build targets related settings can be either visible or not. If they 're visible, they allow the user to customize per-target the target's name, working directory and objects output (intermediate) directory.
Parameter | Type | Description |
---|---|---|
compilerID | wxString | The preselected compiler ID for the list. If this string is empty, the globally default compiler will be selected. |
validCompilerIDs | wxString | A semicolon separated list of valid compiler IDs to include in the list. If you want all available compilers to be listed, use _T("*") . If you want only GCC-based or MSVC-based compilers to appear in the list, use _T("gcc*;msv*") .
|
allowCompilerChange | bool | If true, the user will be able to change the compiler selection. If false, the selection will be read-only. |
allowConfigChange | bool | If true, the settings for the two pre-defined build targets (Debug/Release) will be shown and available for the user to customize. If false, they will not be visible. |
AddBuildTargetPage(targetName, isDebug, showCompiler, compilerID, validCompilerIDs, allowCompilerChange)
Adds a page for creating a new build target. This page allows the user to enter a name for the new build target, set its working directory, set its objects output (intermediate) directory and, optionally, a compiler selection list.
It also contains a checkbox to denote whether this target should have debugging symbols enabled or not.
The compilers' list can contain all supported compilers or a script-defined list. It can also be selected whether compiler selection will be enabled or not.
Parameter | Type | Description |
---|---|---|
targetName | wxString | The new target's name. |
isDebug | bool | If true, the "Enable debugging symbols" check box will be checked. |
showCompiler | bool | If true, the compiler selection list will be visible. |
compilerID | wxString | The preselected compiler ID for the list. If this string is empty, the globally default compiler will be selected. |
validCompilerIDs | wxString | A semicolon separated list of valid compiler IDs to include in the list. If you want all available compilers to be listed, use _T("*") . If you want only GCC-based or MSVC-based compilers to appear in the list, use _T("gcc*;msv*") .
|
allowCompilerChange | bool | If true, the user will be able to change the compiler selection. If false, the selection will be read-only. |
AddGenericSingleChoiceListPage(pageId, descr, choices, defChoice)
Adds a page that contains a script-defined list and the user can select one single value from it.
Parameter | Type | Description |
---|---|---|
pageId | wxString | The page's ID. |
descr | wxString | The description displayed at the top of the page. |
choices | wxString | Semicolon separated list of the available selections. |
defChoice | int | The pre-selected choice. This is used only the first time this page is displayed. The user's selection is stored in the Code::Blocks configuration file and remembered for subsequent uses of this page. |
AddGenericSelectPathPage(pageId, descr, label, defValue)
Adds a page that allows the user to select a folder from the filesystem.
Parameter | Type | Description |
---|---|---|
pageId | wxString | The page's ID. |
descr | wxString | The description displayed at the top of the page. |
label | wxString | The label above the text box (e.g. "Location of Foo:"). |
defValue | wxString | The pre-selected path. This is used only the first time this page is displayed. The user's selection is stored in the Code::Blocks configuration file and remembered for subsequent uses of this page. |
AddPage(pageId)
Adds a custom page from XRC resource.
Parameter | Type | Description |
---|---|---|
pageId | wxString | The page's ID. This must match the wxPanel's name in the XRC resource. |
(to be continued)
Mandrav 11:28, 9 July 2006 (EDT)