Search found 15137 matches

by doublemax
Mon Jul 03, 2006 8:18 am
Forum: C++ Development
Topic: Draw 8 bit bitmap
Replies: 5
Views: 1263

are you sure the right wxBitmap ctor is called? It seems to me that this one is used which will probably cause some kind of assertion (because of the type parameter): wxBitmap(void* data, int type, int width, int height, int depth = -1) However, i'm not sure you can create raw bitmaps like this. Che...
by doublemax
Sun Jul 02, 2006 1:40 pm
Forum: C++ Development
Topic: wxPalette::GetColoursCount
Replies: 3
Views: 909

if GetColoursCount is not implemented, don't use it. The rest of the code works fine. Did you actually fill the red, green, blue arrays with meaningful values before creating the palette?
by doublemax
Sat Jul 01, 2006 3:40 pm
Forum: C++ Development
Topic: Mainloop for a gamelike system
Replies: 26
Views: 6384

B_old wrote:I don't believe the code you posted will work well.
Think about it.
MainLoop only gets called once, the loop part is happening inside.
Yes, you're right. I removed the code snippet above...
by doublemax
Sat Jul 01, 2006 3:11 pm
Forum: C++ Development
Topic: Mainloop for a gamelike system
Replies: 26
Views: 6384

catching the idle event will have pretty much the same effect (except for some overhead, but if that's in issue, wxwidgets is not the right tool anyway)

Edit: wrong code deleted
by doublemax
Sat Jul 01, 2006 1:05 pm
Forum: C++ Development
Topic: Mainloop for a gamelike system
Replies: 26
Views: 6384

i don't really understand why you need your own "mainloop". wxWidgets has an internal one already, so why don't you just use the event system like any "normal" application would?

If you need code that runs 'endlessly', you can put it in an idle event or into a secondary thread.
by doublemax
Fri Jun 30, 2006 9:07 am
Forum: C++ Development
Topic: wxString and wxInputStream and wxOutputStream
Replies: 9
Views: 2729

you should rewrite your code, so that you don't depend on knowing the filesize. Use an inputbuffer of fixed size and read the file in parts until wxInputStream::LastRead() returns 0.
by doublemax
Fri Jun 30, 2006 9:04 am
Forum: C++ Development
Topic: [VC++.NET, files > 2 GB]
Replies: 9
Views: 1978

yes, you're right. Seems that wxFFile internally depends on fseeko, too. Sorry about that.

In that case i really don't know an easy solution. If it was only about fgets() you could implement that yourself in a few minutes, fscanf however might me a little more work ;)
by doublemax
Thu Jun 29, 2006 6:35 pm
Forum: C++ Development
Topic: Question about sizing
Replies: 1
Views: 383

do you actually assign your sizer to your frame?
In C++ there would be a line like

Code: Select all

yourwxFrame->SetSizer(yoursizer);
And what about the wx::Shaped flag? In c++ you would set the flag for each item added to the sizer, not to the sizer itself. Try wx::EXPAND and see if it changes anything.
by doublemax
Thu Jun 29, 2006 1:39 pm
Forum: C++ Development
Topic: Iterate through files in disk
Replies: 1
Views: 555

Code: Select all

wxDir
wxDirTraverser
by doublemax
Thu Jun 29, 2006 12:06 pm
Forum: C++ Development
Topic: [VC++.NET, files > 2 GB]
Replies: 9
Views: 1978

look at wxFFile and wxFFile::Attach (note the double 'F')
by doublemax
Wed Jun 28, 2006 2:56 pm
Forum: C++ Development
Topic: Mouse fly over wxTextCtrl
Replies: 4
Views: 932

i'm sure mouse enter/leave events work for wxTextCtrl objects, too.

I guess you only have an event table for your wxFrame. In that case you could use yourtextctrl->Connect() to connect your mouse enter/leave methods to your text controls.
by doublemax
Tue Jun 27, 2006 6:39 pm
Forum: C++ Development
Topic: Can the standard class name for a window be changed?
Replies: 2
Views: 706

AFAIK there is no method to change this from user code, but you could of course just change it in the wxWidgets sources. (in src/msw/app.cpp)
by doublemax
Tue Jun 27, 2006 3:55 pm
Forum: C++ Development
Topic: wxNotebook problem
Replies: 4
Views: 944

ghostdev85 wrote:Well....
fatal error... the kind that on linux it says segmentation fault... and on windows xp it pops out send error report that kind...
How about using a debugger?
And what exactly are you doing with that pointer?
And why do you need that pointer at all? why can't you just use "this"?
by doublemax
Tue Jun 27, 2006 2:51 pm
Forum: C++ Development
Topic: open a jpeg file in a window and recover RGB value
Replies: 2
Views: 704

i wouldn't try to read the rgb value from the screen. Instead, load your image into a wxImage. Then in the OnClick method of your wxFrame (or whatever object you use to display the image), convert the window coordinates into image coordinates (which depends on a few factors like scaling, offset etc)...
by doublemax
Tue Jun 27, 2006 7:02 am
Forum: C++ Development
Topic: wxDir: out of order files & folders
Replies: 1
Views: 742

Files are returned in the physical order they appear in the directory and you'll have to sort them yourself. E.g. put them in a wxArrayString