Search found 23 matches

by Thelvyn
Mon Apr 17, 2006 3:33 pm
Forum: C++ Development
Topic: wxString: How to get character code of wxChar ?
Replies: 12
Views: 1950

Perhaps what he needs to do is convert the string from ansi to unicode ? PWSTR StrA2W( PCSTR Data, PWSTR dest, int buflen ) { // convert from LPSTR to LPWSTR assert( Data != NULL ); assert( Data[0] != NULL ); if( Data == NULL || Data[0] == NULL ) { return NULL; } size_t acp = GetACP(); if( buflen ==...
by Thelvyn
Tue Apr 11, 2006 4:31 am
Forum: The Code Dump
Topic: Latest wxTreeMultiCtrl Code
Replies: 36
Views: 13144

This is actually unrelated to your code but I ran into the ESP problem a week ago and it had something to do with the event table. If I commented out the DECLARE_EVENT_TABLE() then the problem went away, even if the event table was empty it did the same thing, complained that ESP was not properly sa...
by Thelvyn
Tue Apr 11, 2006 2:09 am
Forum: The Code Dump
Topic: wxTreeCtrl and multiply displayed items - Saving memory
Replies: 1
Views: 1496

Here is the revised template version. Also I was thinking of making it match wxTreeCtrl's interface more closely so that for all intents you could use this directly assuming that you have appended at least 1 item so it has the tree control pointer of course. If there is any interest let me know and ...
by Thelvyn
Mon Apr 10, 2006 10:24 am
Forum: The Code Dump
Topic: wxTreeCtrl and multiply displayed items - Saving memory
Replies: 1
Views: 1496

wxTreeCtrl and multiply displayed items - Saving memory

I have a tree control where I display thousands of items from a database. Thing is objects can be displayed in multiple places at the same time depending on the objects attributes. So I wrote this class, well two but one is negligable and only used as a base class for objects, could also rewrite it ...
by Thelvyn
Wed Apr 05, 2006 2:14 pm
Forum: C++ Development
Topic: How do I return Parent that is top level window?
Replies: 9
Views: 3657

I merely used the frame as an example of finding a specific window type from a nested class. Could just as easily find a wxDialog based class in the same manner. And how often do you create a dialog without a parent unless its the top level window to start with ? Thats not good practice in general. ...
by Thelvyn
Wed Apr 05, 2006 4:42 am
Forum: C++ Development
Topic: How do I return Parent that is top level window?
Replies: 9
Views: 3657

I do believe your solution ends up doing the same thing just in a more convuluted way. If he wants to find a specific window thats a different story. wxFrame* GetParentFrame(wxWindow* pWindow) { wxWindow* pWin = pWindow; wxFrame* pFrame = NULL; while( NULL == pFrame ) { pFrame = dynamic_cast<wxFrame...
by Thelvyn
Tue Apr 04, 2006 7:56 am
Forum: C++ Development
Topic: How do I return Parent that is top level window?
Replies: 9
Views: 3657

I believe this does what you want actually. wxWindow * wxApp::GetTopWindow() Returns a pointer to the top window. If the top window hasn't been set using wxApp::SetTopWindow, this function will find the first top-level window (frame or dialog) and return that. or you could try this wxWindow* wxWindo...
by Thelvyn
Fri Mar 31, 2006 9:26 am
Forum: C++ Development
Topic: wxTreeCtrl and Owner DATA - not DRAW :)
Replies: 2
Views: 582

Sorry I am unclear how you mean that.
would I have to handle these and then set unset as I go ?
EVT_TREE_ITEM_COLLAPSED
EVT_TREE_ITEM_EXPANDING

I thought it would have to do with EVT_TREE_GET_INFO

Or am I totally off base here?
by Thelvyn
Fri Mar 31, 2006 9:18 am
Forum: C++ Development
Topic: open drop down box using wxComboBox ?
Replies: 6
Views: 1194

I need this to work in linux as well, is there a wxWhatever define to do this ?
I would think that it would have something to do with events but how ?
by Thelvyn
Fri Mar 31, 2006 2:06 am
Forum: C++ Development
Topic: wxTreeCtrl and Owner DATA - not DRAW :)
Replies: 2
Views: 582

wxTreeCtrl and Owner DATA - not DRAW :)

in windows with mfc or without I can make a tree control ask me for the text when it needs to display it. I just set LPSTR_TEXTCALLBACK and it then asks me for the string when it needs it. Is there a way to do this with wxTreeCtrl ? I need to display thousands of items(a db view basically) and they ...
by Thelvyn
Fri Mar 31, 2006 1:55 am
Forum: C++ Development
Topic: open drop down box using wxComboBox ?
Replies: 6
Views: 1194

Unfortunately I never did find a solution to this. The code you pointed me to was not quite what I had in mind thank you though.
by Thelvyn
Fri Mar 31, 2006 1:43 am
Forum: Compiler / Linking / IDE Related
Topic: string problem in VC++ Express
Replies: 8
Views: 990

That code should work fine, ive been using strings like that since turbo C++ 1.x and its always worked with every compiler to date. I do not however have that compiler to test it on.

Maybe you could give us some more context and then we can ascertain what the real problem is.
by Thelvyn
Tue Mar 28, 2006 4:40 am
Forum: C++ Development
Topic: Creating an event based on the state of a widget
Replies: 9
Views: 1115

If your using wxwindows its gonna be big no ifs or buts about that.
I wrote a console program that uses nothing but wxString so yea you can just include the headers you need as far as I know.
by Thelvyn
Tue Mar 28, 2006 2:01 am
Forum: C++ Development
Topic: Creating an event based on the state of a widget
Replies: 9
Views: 1115

You may have never used enums but you do have them. examples enum { Ok = 0, im, so, bad, sometimes }; or a named enum enum _state { Ok = 0, im, so, bad, sometimes }; btw they get numbered seq automatically so im=1 so=2 etc you can then do things like void foo( _state StatVar ) The problem with enum ...
by Thelvyn
Mon Mar 27, 2006 6:49 pm
Forum: C++ Development
Topic: Problem with de wxTextCtrl
Replies: 8
Views: 1276

Under what circumstances are you experiencing this ?
I threw together a program to test and using AppendText it does not exhibit this behaviour on my system, wxWidgets 2.6.2 MSW.

Could you give me an example of how your doing it ?