Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Modified & Improved wxWidgets Project Wizard

<< < (35/41) > >>

mandrav:

--- Quote ---The only thing I haven't found out yet is how to check if WxsAddWxExtensions function is defined using script's code - if it's not, wxSmith RAD should be disabled (or it should show some message).
--- End quote ---

To those interested in this, the "safe" way to check if a function exists without raising an error, is this:


--- Code: ---if ("WxsAddWxExtensions" in getroottable())
{
    ...
}

--- End code ---

@byo: it's great that you added the first wxSmith script binding :). But make sure to de-register it when the plugin is unloaded (at least if the app is not shutting down). If you don't know how to do it, check compilergcc.cpp: it does this for a script function named "BuildLog" iirc.

byo:

--- Quote from: mandrav on February 21, 2007, 11:05:51 pm ---
--- Code: ---if ("WxsAddWxExtensions" in getroottable())
{
    ...
}

--- End code ---

--- End quote ---

Jay, that's everything we need :D Thanks Boss :)


--- Quote ---@byo: it's great that you added the first wxSmith script binding :). But make sure to de-register it when the plugin is unloaded (at least if the app is not shutting down). If you don't know how to do it, check compilergcc.cpp: it does this for a script function named "BuildLog" iirc.

--- End quote ---

Yup, right, forgot to unregister, thansk again ;)

EDIT:

I guess that mentioned function is not unregistered in compilergcc.cpp coz I couldn't find it :(

MortenMacFly:

--- Quote from: byo on February 22, 2007, 12:31:29 am ---EDIT:
I guess that mentioned function is not unregistered in compilergcc.cpp coz I couldn't find it :(

--- End quote ---
It is as simple as that:

--- Code: ---    // disable script functions
    ScriptBindings::gBuildLogId = -1;

--- End code ---
(in void CompilerGCC::OnRelease(bool appShutDown))... If I get Yiannis correctly.
With regards, Morten.

Biplab:
Hi Everybody,

Here is an glimpse of the next most interesting change in wxWidgets wizard. We're trying to add support for wxSmith or wxFormBuilder right through the wizard. Here is the first part.

Feature:

* Supports Only wxFormBuilder+wxFrame based app.
Warning:

* This is a development release and may contain serious bug. Download it only if you wish to test it.
* Latest wizard has not been tested in Linux.
I'll commit it to main repository after some more tests.

@rjmyst3

Please test it once and give your feedback. :)

@byo

wxSmith support will be added after I finish this one. :)

Regards,

Biplab

[attachment deleted by admin]

byo:

--- Quote from: MortenMacFly on February 22, 2007, 07:59:53 am ---
--- Quote from: byo on February 22, 2007, 12:31:29 am ---EDIT:
I guess that mentioned function is not unregistered in compilergcc.cpp coz I couldn't find it :(

--- End quote ---
It is as simple as that:

--- Code: ---    // disable script functions
    ScriptBindings::gBuildLogId = -1;

--- End code ---
(in void CompilerGCC::OnRelease(bool appShutDown))... If I get Yiannis correctly.
With regards, Morten.

--- End quote ---

Nop, it won't unregister function from squirrel, it will simply make this function do nothing. But if copmpiler's dll is unloaded, any call to this function from script will cause a seg fault. I've already looked into squirrel and probably got a solution, but have to test it.

/EDIT:
Following part of code does the job:

--- Code: ---    Manager::Get()->GetScriptingManager();
    HSQUIRRELVM v = SquirrelVM::GetVMPtr();
    if ( v )
    {
        sq_pushroottable(v);
        sq_pushstring(v,"WxsAddWxExtensions",-1);
        sq_deleteslot(v,-2,false);
        sq_poptop(v);
    }
--- End code ---
EDIT/


--- Quote from: Biplab on February 22, 2007, 05:50:12 pm ---@byo
wxSmith support will be added after I finish this one. :)

--- End quote ---
No problem, there's no rush. I hope to have it in 1.0 final, and it rather won't be released in a week ;)

BYO

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version