Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

Using "wxCheckListBox" in a wizard project

(1/2) > >>

LETARTARE:
Hello,
II try to change the project creation wizard for "Avr Project" by adding a third page of choice additional libraries.
This setting uses a widget "wxCheckListBox" named "lib_addons" with fields: libA, libB, libC, libD.

I changed it to "wizard.xrc" and "wizard.script"

A-Modifications "wizard.xrc"
     see *.zip

B-Modifications "wizard.script"

1 - global variables

--- Code: ---/// ------------------------------
/// LETARTARE for wxCheckListBox
LibNumbers <- _T ("");
LibString <- _T ("");
/// <----------------------------
--- End code ---

2 - in "BeginWizard function ()"

--- Code: ---/// ---------------------------------------------------------------------
/// For testing LETARTARE "wiz::GetListboxStringSelections (wxString &)"
/// Page "libraryChoice" contents "wxCheckListBox"
       Wizard.AddPage (_T ("libraryChoice")) /// inside "wizard.xrc"
/// <-------------------------------------------------------------------
--- End code ---

3 - I created the following function to display the values ​​retrieved

--- Code: ---/// ----------------------------------------------- ---------------------
/// LETARTARE : lib_addons
/// functions available for "wxCheckListBox"
/// int GetListboxSelection(const wxString& name); // with ONLY ONE SELECTION !!!
/// wxString GetListboxSelections(const wxString& name);
/// wxString GetListboxStringSelections(const wxString& name);
/// void SetListboxSelection(const wxString& name, int sel);


function OnLeave_libraryChoice (fwd)
{
    if (fwd)
    {
        LibNumbers = Wizard.GetListboxSelections (_T ("lib_addons"));
       /// Console output for test scripting
       ::print (_T ("->") +  LibNumbers  + _T ("<-"));
        if (LibNumbers.IsEmpty ()) {
             ::print (_T ("No selected library"));
        }
        else {
              LibString = Wizard.GetListboxStringSelections (_T ("lib_addons"));
             ::print (_T ("lib_addons = ") + LibString);
        }
    }
    return true;
}
/// <-------------------------------------------------------------------
--- End code ---

Disregard of space errors in quotations !!

4 - Results:
creation is correct but:

--- Quote ---     - The variable LibNumbers is always equal to 0 !
     - Variable LibString is always empty!
--- End quote ---


I can not find my mistake?

Cordially.

MortenMacFly:

--- Quote from: LETARTARE on January 19, 2013, 06:14:43 am ---I can not find my mistake?

--- End quote ---
What version of C::B do you use? IMHO scripting support for wxCheckListBox was added just recently.

LETARTARE:
hello,
C::B 12.11
I found the access functions in wiz.h and wiz.cpp
cordially

Jenna:
You ask for selected item, these are the item(s) which is/are highlighted, not the item(s) with a checked checkbox.
wxCheckListBox is not (yet) implemented as far as I can see.

LETARTARE:
thanks you jens.
The box checked are they planned in the near future ?

Navigation

[0] Message Index

[#] Next page

Go to full version