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

wxSmith development

<< < (10/34) > >>

cyberkoa:

--- Quote from: byo ---
--- Quote from: cyberkoa ---Thx,understood.  The flag indicate whether the widget is static widget (keep in xrc) or dynamics created using C++ code . Hmm ,this is important in code generation.
--- End quote ---


Hmm, not exackly. The flag indicating whether dialgo uses XRC or should be inside dialog resource, not one widget.

Maybe will describe with a bit of code (example what would be generated from wxSmith;) ):

1). One widget with VarNotStored = false

--- Code: ---class MyDialog: public wxDialog
{
  public:
    MyDialog(...)
    {
      Widget = new wxStaticText(this,-1,"Hello world");
    }
  protected:
    wxStaticText* Widget;
}

--- End code ---


2). One widget with VarNotStoredd = true

--- Code: ---class MyDialog: public wxDialog
{
  public:
    MyDialog(...)
    {
      wxStaticText* Widget;
      Widget = new wxStaticText(this,-1,"Hello world");
    }
}

--- End code ---


So if VarNotStored == true, it means that Variable for this widget will be created locally inside function creating dialog, VarNotStored == false means that it will be a member of class and will be acessible from other members in this class.

Hope I've explained this now :)
--- End quote ---


Ok, totally understand. I think the best language to communicate among programmers is computer language  :lol:   :lol:


--- Quote from: rickg22 ---Uh... shouldn't you change the name to IsMember or something?
--- End quote ---


A good recommentation, I think.

Anonymous:

--- Quote ---So if VarNotStored == true, it means that Variable for this widget will be created locally inside function creating dialog, VarNotStored == false means that it will be a member of class and will be acessible from other members in this class.
--- End quote ---

Isn't the local variable still available to other member functions due to the "this" linkup (just not as a member)?  Otherwise, the var would be an invalid memory location--as it is released at the end of the function automatically (scope, delete is implied)--and the active dialog would continue pointing to these released memory locations (it doesn't since the pointer's reference counter > 0).  Isn't there a mechanism to step throught the widgets of a window?  Or is "VarNotStored" simply a way to separate direct access to widgets from indirect access, so that the programmer can concentrate on the direct items?
I agree the "isMember" might be a better var name.

DreadNot:
Above was mine.

byo:

--- Quote from: Anonymous ---Isn't the local variable still available to other member functions due to the "this" linkup (just not as a member)?  Otherwise, the var would be an invalid memory location--as it is released at the end of the function automatically (scope, delete is implied)--and the active dialog would continue pointing to these released memory locations (it doesn't since the pointer's reference counter > 0).  Isn't there a mechanism to step throught the widgets of a window?  Or is "VarNotStored" simply a way to separate direct access to widgets from indirect access, so that the programmer can concentrate on the direct items?
I agree the "isMember" might be a better var name.
--- End quote ---


Hmm these variables will be actually pointers to real widgets. And these widgets could be later found through FindWindow() or something like this.

byo:
Hmm, and another thing.
I currently have hard times during my study (need to pass all these exams etc. etc. ) so wxSmith won't be updated regularly :(
Hope You  won't be angry  :oops:

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version