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

Problem with wxSmith

<< < (2/2)

killerbot:
Another question :

the dialog has several sizers, how to you "GetSizer" the correct one ??

For example : I need the  "StaticBoxSizer1"

    <object class="wxDialog" name="CcDialog">
        <title>ClearCase Plug-in for Code::Blocks</title>
        <style>wxCAPTION|wxTHICK_FRAME|wxSYSTEM_MENU|wxCLOSE_BOX</style>
        <object class="wxBoxSizer" variable="BoxSizer1" member="no">
            <orient>wxVERTICAL</orient>
            <object class="sizeritem">
                <option>1</option>
                <border>5</border>
                <flag>wxALL|wxALIGN_CENTER|wxEXPAND</flag>
                <object class="wxStaticBoxSizer" variable="StaticBoxSizer1" member="no">

byo:

--- Quote from: killerbot on November 02, 2005, 04:52:19 pm ---Another question :

the dialog has several sizers, how to you "GetSizer" the correct one ??

For example : I need the  "StaticBoxSizer1"

    <object class="wxDialog" name="CcDialog">
        <title>ClearCase Plug-in for Code::Blocks</title>
        <style>wxCAPTION|wxTHICK_FRAME|wxSYSTEM_MENU|wxCLOSE_BOX</style>
        <object class="wxBoxSizer" variable="BoxSizer1" member="no">
            <orient>wxVERTICAL</orient>
            <object class="sizeritem">
                <option>1</option>
                <border>5</border>
                <flag>wxALL|wxALIGN_CENTER|wxEXPAND</flag>
                <object class="wxStaticBoxSizer" variable="StaticBoxSizer1" member="no">


--- End quote ---


OK, let's see, it would be something like this (Haven't tested that but it should be working ;) ):


--- Code: ---wxSizer* MainSizer = GetSizer(); // Getting BoxSizer1 item
wxStaticBoxSizer* Sizer = (wxStaticBoxSizer*)( MainSizer->GetItem(0)->GetSizer() );
wxStaticBox* Box = Sizer->GetStaticBox();
Box->SetLabel(_("Anything You want :)"));
--- End code ---

(I would add some NULL checks, one small XRC file change and C::B crashes.)

Maybe new dll will be included in next binary snapshot by ceniza (http://gda.utp.edu.co/~ceniza/CodeBlocks/). But I really don't know when it will be ;)

Navigation

[0] Message Index

[*] Previous page

Go to full version