Search found 34 matches

by shawnhcorey
Mon Sep 28, 2015 6:07 pm
Forum: C++ Development
Topic: wxImage not building correct image
Replies: 4
Views: 338

[solved] Re: wxImage not building correct image

OK, after some heavy thinking, this seems to work: void vwClock::UpdateDisplay ( int hr, int min, int sec, bool force ){ wxMemoryDC dc; // change hour-minute face when new minute if( sec == 0 || force ){ int hour_index = ( hr * 5 + min / 12 ) % 60; dc.SelectObject( m_hr_min_face ); dc.SetBackground(...
by shawnhcorey
Mon Sep 28, 2015 4:27 pm
Forum: C++ Development
Topic: wxImage not building correct image
Replies: 4
Views: 338

Re: wxImage not building correct image

The bitmaps have to have an alpha channel. If they didn't, there would be only one hand, not a bunch drawn over top of each other. So, you're saying I should use wxMemoryDC to store the composite images? Rotated bitmaps look ugly. That's why I have 60 rendered PNGs for each hand. And there are 3 han...
by shawnhcorey
Mon Sep 28, 2015 2:25 pm
Forum: C++ Development
Topic: wxImage not building correct image
Replies: 4
Views: 338

wxImage not building correct image

I'm trying to build a simple analog clock using PNG files for the hands. The problem I have is I cannot get wxImage to paste the layers together. It seems to use only the last wxImage, that of the second hand and reuses it each time. See attached Screenshot-sysmon.png The only thing I found close to...
by shawnhcorey
Sun Jul 19, 2015 5:08 pm
Forum: Compiler / Linking / IDE Related
Topic: Compiling AUI Doc/View example
Replies: 4
Views: 783

Re: Compiling AUI Doc/View example

doublemax wrote:wxWidgets 3.1 and 2.8.12 are very different and not compatible
That could be a problem. I'm not sure my OS can handle an incompatible library. :(
by shawnhcorey
Sun Jul 19, 2015 4:15 pm
Forum: Compiler / Linking / IDE Related
Topic: Compiling AUI Doc/View example
Replies: 4
Views: 783

Re: Compiling AUI Doc/View example

T-Rex wrote:You probably forgot to install wxWidgets on your system.
Nope.

Code: Select all

$ wx-config --version-full
2.8.12.1
by shawnhcorey
Sun Jul 19, 2015 2:41 pm
Forum: Compiler / Linking / IDE Related
Topic: Compiling AUI Doc/View example
Replies: 4
Views: 783

Compiling AUI Doc/View example

I have cloned this repository: https://github.com/wxWidgets/wxWidgets/tree/master/samples/docview and compiled it: $ ./configure # lots of output $ make # more output, some warnings but compiled $ I then tried: $ ./utils/wxrc/wxrc ./utils/wxrc/wxrc: error while loading shared libraries: libwx_baseu_...
by shawnhcorey
Thu Jun 18, 2015 3:18 pm
Forum: C++ Development
Topic: Memory deallocation
Replies: 10
Views: 1008

Re: Memory deallocation

Permanent widgets should be allocated with `new`. Temporary ones can be allocated on the stack. Actually there are only two types of objects that can be created on the stack under certain circumstances: Modal dialogs and popup menus. What about wxString? There are a number of "widgets" that don't h...
by shawnhcorey
Thu Jun 18, 2015 2:02 pm
Forum: C++ Development
Topic: Memory deallocation
Replies: 10
Views: 1008

Re: Memory deallocation

Those are allocated on the stack. If the allocation has the keyword `new`, it is allocated on the heap and must be explicitly freed. Otherwise, it is allocated on the stack and will be freed when the function returns. If I'm not mistaken, all that widgets were allocated using the keyword new , whic...
by shawnhcorey
Thu Jun 18, 2015 12:58 pm
Forum: C++ Development
Topic: Memory deallocation
Replies: 10
Views: 1008

Re: Memory deallocation

However, there is no code which does the deallocation. Is it a memory leak, or does wxWidgets deallocate everything automatically? No, C++ does. Those are allocated on the stack. When the function returns, the memory on the stack is recovered. How can you tell the difference? If the allocation has ...
by shawnhcorey
Thu Feb 05, 2015 2:01 pm
Forum: C++ Development
Topic: wxDateTime question
Replies: 7
Views: 1213

Re: wxDateTime question

In trying to set upper and lower limits to a range of dates - span over centuries - I have run into some question in trying to understand how wxDateTime works out some of the conversions. For instance wxString wsT; wxDateTime wdtDate( (time_t) 0x7fffffffffffffff ); // wsT = UTC: 1969-12-31T23:59:59...
by shawnhcorey
Wed Sep 24, 2014 12:07 pm
Forum: C++ Development
Topic: Application design
Replies: 6
Views: 848

Re: Application design

Thanks, but it's not a matter how to deploy source files, but rather how to design an application to separate wxwidget specific code from application logic. If you mean how to deploy the code so that the wxWidgets code is separate from the domain-model code? And since you don't want to keep them in...
by shawnhcorey
Tue Sep 23, 2014 5:40 pm
Forum: C++ Development
Topic: Application design
Replies: 6
Views: 848

Re: Application design

I usually create prefixes for my files to categorize them: adm... Administration: special controls for privileged users. app... Starts the app. Acquires systems resources. Cleans up & frees resources when done. Handles wxFrame and derived classes. aux... Auxiliary controls: menus, toolbars, status b...
by shawnhcorey
Fri Sep 12, 2014 11:46 am
Forum: General Development
Topic: wxFormBuilder won't build what I want
Replies: 8
Views: 3258

Re: wxFormBuilder won't build what I want

New Pagodi wrote:I love formbuilder, but I suppose it can be a bit picky about what it allows to be a child of certain controls.
Thanks. Though that seems to be a lot of sizers and panels. :?
by shawnhcorey
Thu Sep 11, 2014 6:47 pm
Forum: General Development
Topic: wxFormBuilder won't build what I want
Replies: 8
Views: 3258

Re: wxFormBuilder won't build what I want

In other words, wxFormBuilder is not a very good guide. :(
by shawnhcorey
Thu Sep 11, 2014 6:11 pm
Forum: General Development
Topic: wxFormBuilder won't build what I want
Replies: 8
Views: 3258

wxFormBuilder won't build what I want

I am trying to build something like this: AppNBPage : wxPanel wxSplitterWindow wxTreeCtrl wxGrid AppMainWin : wxFrame AppMainPanel : wxPanel wxBoxSizer AppMenuBar : wxMenuBar AppToolBar : wxToolBar AppSttusBar : wxStatusBar AppNB : wxAUINotebook AppNBPage ... 1. wxFormBuilder won't let me put a wxBo...