Search found 286 matches

by Radek
Sat Feb 23, 2013 5:05 am
Forum: C++ Development
Topic: Using Custom Control in XRC
Replies: 3
Views: 2466

Re: Using Custom Control in XRC

The simplest (and most flexible) method is using AttachUnknownControl(). (1) In the wxFormBuilder, create a "custom" control and give it class "custom" (the class must be "custom"). (2) In the MyDialog ctor create the CustomBook (using new ). (3) wxXmlResource::Get()->AttachUnknownControl( wxT("name...
by Radek
Fri Feb 22, 2013 4:36 pm
Forum: C++ Development
Topic: Can't call button from another frame
Replies: 4
Views: 1341

Re: Can't call button from another frame

IMO, your problem has the name "wxSmith". For some unknown reason, Code Blocks decided to make all data members of wxSmith created classes private . You create a frame, put a button in it and the button cannot be controlled from outside the frame class because the pointer to the button is private an...
by Radek
Thu Feb 21, 2013 5:34 am
Forum: C++ Development
Topic: wxString cannot hold more than 65536 characters
Replies: 11
Views: 2877

Re: wxString cannot hold more than 65536 characters

This is not a problem of wxRichTextCtrl, this seems to be a problem with windows GUI multiline edit control. I have written a help viewer which has processed texts longer than 100k many times on Debian - no troubles. As far as windows is concerned, I can be of little help because I am not running wi...
by Radek
Mon Feb 18, 2013 5:45 am
Forum: C++ Development
Topic: Correctness of wxDC::GetTextExtent() for fixed width fonts
Replies: 7
Views: 3021

Re: Correctness of wxDC::GetTextExtent() for fixed width fon

IMO, the problem consists in rounding errors when computing the text width. The resulting error will depend on the algorithm used for computing the text extent. If you want more control on computing the text extent then there is GetPartialTextExtents(). Fixed pitch fonts should be really fixed pitch...
by Radek
Fri Feb 15, 2013 10:13 am
Forum: C++ Development
Topic: Displaying Pictures
Replies: 3
Views: 5996

Re: Displaying Pictures

There is a wxStaticBitmap class. Put the wxStaticBitmap where you want it in your frame and set an image for it. You can set the image from your code. You can change the image when you want. If you are using some kind of "GUI designer" and resource files then you can specify the image in the resourc...
by Radek
Thu Feb 14, 2013 2:20 pm
Forum: C++ Development
Topic: Dialog Destroy not works in wxFileDialog
Replies: 9
Views: 2735

Re: Dialog Destroy not works in wxFileDialog

Sorry, your code makes no sense. There is a class MyDialog but there is no instance of it. The MyDialog contains a pointer to a taskbar class - again, there is no instance of the taskbar around. The taskbar::exit() method declares a pointer to the MyDialog but it does not initialize it. When the lin...
by Radek
Mon Feb 04, 2013 6:47 am
Forum: C++ Development
Topic: Posting event from boost thread to GUI thread
Replies: 10
Views: 3276

Re: Posting event from boost thread to GUI thread

Here is my "custom event" (see attachment). The attachment contains a working project: a frame with two buttons that post and send custom events to a text ctrl. The text ctrl displays what it got from the buttons. It's a very simple single thread app (it could be multithreaded, but I wanted a simple...
by Radek
Sat Feb 02, 2013 8:07 am
Forum: Compiler / Linking / IDE Related
Topic: codeblocks and wxWidgets
Replies: 1
Views: 1343

Re: codeblocks and wxWidgets

Libraries wxmswd_core (perhaps, .lib, I am not running windows) etc. have not been found. The 'd' at the end of library names hints that Code Blocks are trying to link the debug versions of the libraries. This could be wrong, you want to debug your program and not wxWidgets most likely. Look at "Pro...
by Radek
Thu Jan 24, 2013 12:02 pm
Forum: C++ Development
Topic: Connecting Scroll Event
Replies: 10
Views: 2401

Re: Connecting Scroll Event

(1) The event is "scroll" and not "scrollwin": wxEVT_SCROLL_TOP and wxScrollEventHandler. wxScrollWinEventHandler should not exist. This may be the source of complaints. (2) The scrollbar should be a wxWindow. Get a pointrer to the scrollbar somehow and try dynamic_cast<wxWindow *>(ptr_to_srollbar)....
by Radek
Thu Jan 24, 2013 11:00 am
Forum: C++ Development
Topic: Connecting Scroll Event
Replies: 10
Views: 2401

Re: Connecting Scroll Event

Code: Select all

HexGridG-Connect(
                  ID_of_the_scrollbar,
                  wxEVT_SCROLL_TOP,
                  wxScrollEventHandler(class_snippet::eGrid_OnScrollHome),
                  NULL,
                  pointer_to_the_instance_of_class_snippet
                );
by Radek
Thu Jan 24, 2013 9:14 am
Forum: C++ Development
Topic: how to find percentage completed value in Progress Dialog
Replies: 3
Views: 952

Re: how to find percentage completed value in Progress Dialo

The gauge is a tool, not an intelligent beast. You are sending values to the gauge and the gauge is displaying them. Period. For (1) - (4) is responsible the dialog logic. For example: when sending 100 to the gauge, change the button text to Close, change the text to Success and so on. The gauge has...
by Radek
Thu Jan 24, 2013 5:40 am
Forum: C++ Development
Topic: WxTreeCtrl with mith multiple data wxTreeItemData
Replies: 6
Views: 2168

Re: WxTreeCtrl with mith multiple data wxTreeItemData

I would do something like T-Rex's recommendation 2. (1) Create a base class derived from wxTreeItemData. This class contains an enum which identifies the type of data and a set of virtual methods specific for particular classes. Do not make these methods abstract in the base class, let them fail som...
by Radek
Tue Jan 22, 2013 8:32 am
Forum: Compiler / Linking / IDE Related
Topic: lnk problem for project using wxwidgets
Replies: 11
Views: 3355

Re: lnk problem for project using wxwidgets

I am not using Visual Studio so that I am not of much help here. Usually, there are several options for handing floating point instructions: "use emulator", "use floating point calls", "inline with coprocessor" and so on. The last one usually means: emit FPU instructions in the code, no calls of any...
by Radek
Tue Jan 22, 2013 7:21 am
Forum: C++ Development
Topic: wxtextCtrl - Width (adjusting in code)
Replies: 7
Views: 3046

Re: wxtextCtrl - Width (adjusting in code)

wxWindow is a base object of wxTextCtrl. The wxTextCtrl inherits all wxWindow methods and data (and adds wxTextCtrl specific ones). Therefore, all wxWindow methods can be used from wxTextCtrl as if they were wxTextCtrl methods. For example SetSize(). You don't need to qualify by wxWindow::SetSize()....
by Radek
Sun Jan 20, 2013 2:55 pm
Forum: Compiler / Linking / IDE Related
Topic: lnk problem for project using wxwidgets
Replies: 11
Views: 3355

Re: lnk problem for project using wxwidgets

IIRC, the __fltused external was emitted by winblows compilers whenever the compiled module used floating point arithmetic. That's because winbows did not use coprocessor and emulate floating point operations using int 3Fh. The external should force linking a library that contained the emulator. Thi...