Search found 67 matches

by silver.moon
Tue Sep 29, 2015 12:12 pm
Forum: C++ Development
Topic: What is wxThreadHelper::GetThread supposed to return after Delete has been called
Replies: 2
Views: 655

Re: What is wxThreadHelper::GetThread supposed to return after Delete has been called

It would be nice if the docs for wxThreadHelper mention the following For Joinable threads never try to delete the thread object returned by GetThread() function, since it is deleted in the wxThreadHelper destructor. Doing so will cause double deletion attempt and hence crash. The confusion was caus...
by silver.moon
Tue Sep 29, 2015 3:54 am
Forum: C++ Development
Topic: How to repaint custom button upon Enable/Disable
Replies: 2
Views: 617

How to repaint custom button upon Enable/Disable

Hi

I have a custom drawn button. When calling Enable/Disable on it, it becomes ugly "for a moment" until something causes it to repaint.

I guess that the button needs to be repainted upon calling Enable/Disable.

How to do this ?
by silver.moon
Tue Sep 29, 2015 3:45 am
Forum: C++ Development
Topic: What is wxThreadHelper::GetThread supposed to return after Delete has been called
Replies: 2
Views: 655

What is wxThreadHelper::GetThread supposed to return after Delete has been called

For a "JOINABLE THREAD" Call

Code: Select all

auto t = GetThread();
t->Delete();
Now if you call GetThread again, what is it supposed to return ? Dangling pointer ? NULL ? What ?

Code: Select all

auto the_unknown = GetThread();  // ???
From what I see in my app, it "does not" seem to return NULL.
by silver.moon
Sat Aug 15, 2015 4:50 am
Forum: C++ Development
Topic: Best way to monitor internet connectivity in a wx app
Replies: 9
Views: 3642

Best way to monitor internet connectivity in a wx app

Hi

My app does things mostly with the internet, so I need a mechanism to get notified when the internet went off.
And again when it came back up.

So that certain tasks can be put on hold till the connectivity is available
by silver.moon
Thu Aug 13, 2015 4:59 am
Forum: C++ Development
Topic: Get notified when selection changes in a wxGrid
Replies: 3
Views: 1061

Re: Get notified when selection changes in a wxGrid

Would you care to elaborate on what you're trying to achieve ? From UI point of view it seems natural to me that only after the mousebutton was released that you can be sure of the new range selected. What do you want to do exactly the moment the user presses the mouse button and is still in the pr...
by silver.moon
Wed Aug 12, 2015 4:15 am
Forum: C++ Development
Topic: Get notified when selection changes in a wxGrid
Replies: 3
Views: 1061

Get notified when selection changes in a wxGrid

wxGrid has an event wxEVT_GRID_RANGE_SELECT which is raised every time the selection in the grid changes.

But it is raised only after the mouse button is released after changing the selection.
How to get notified while the mouse button is pressed and user is changing selection ?
by silver.moon
Tue Aug 11, 2015 5:46 am
Forum: C++ Development
Topic: Doing something in main thread, without blocking GUI
Replies: 3
Views: 1806

Re: Doing something in main thread, without blocking GUI

Thanks, didn't know about wxYield :D But where are the docs ...... its all empty here, http://docs.wxwidgets.org/trunk/classwx_app_console.html#a302adeb701f247bf8cac1570efc25020 For the time, I switched to the worker thread approach. A thread is running all the time, and the gui thread posts the job...
by silver.moon
Sat Aug 08, 2015 12:49 pm
Forum: C++ Development
Topic: How to make just TestDestroy()=true for a thread ?
Replies: 2
Views: 495

Re: How to make just TestDestroy()=true for a thread ?

yeah, another mutexed flag :)
by silver.moon
Sat Aug 08, 2015 12:47 pm
Forum: C++ Development
Topic: Doing something in main thread, without blocking GUI
Replies: 3
Views: 1806

Doing something in main thread, without blocking GUI

Hi I make a network request and data starts pouring in (in blocks) and lots of events are generated within 1 second. The event handler updates the data grid and does some database query. While this is going on the entire gui freezes. Found out that it happens due to the database queries. One option ...
by silver.moon
Wed Aug 05, 2015 6:50 am
Forum: C++ Development
Topic: How to make just TestDestroy()=true for a thread ?
Replies: 2
Views: 495

How to make just TestDestroy()=true for a thread ?

How do I make TestDestroy = true for a thread and without using Delete
I want to just make TestDestroy true and not call Wait on it or delete it.
by silver.moon
Sun Jul 26, 2015 12:26 pm
Forum: C++ Development
Topic: wxDC DrawLabel clip the text to the rectangle
Replies: 3
Views: 911

Re: wxDC DrawLabel clip the text to the rectangle

doublemax wrote:

Code: Select all

dc.SetClippingRegion( rect );
This should work, too.
wow!!
by silver.moon
Sun Jul 26, 2015 4:41 am
Forum: C++ Development
Topic: Need explanation of wxWindow::GetTextExtent parameters
Replies: 1
Views: 551

Need explanation of wxWindow::GetTextExtent parameters

What does descent and externalLeading mean ? void wxWindow::GetTextExtent ( const wxString & string, int * w, int * h, int * descent = NULL, int * externalLeading = NULL, const wxFont * font = NULL ) http://docs.wxwidgets.org/trunk/classwx_window.html#ac9cd7b4472d5419e518f69311914466f
by silver.moon
Sun Jul 26, 2015 2:55 am
Forum: C++ Development
Topic: wxDC DrawLabel clip the text to the rectangle
Replies: 3
Views: 911

Re: wxDC DrawLabel clip the text to the rectangle

Ok solved it using wxDC::SetClippingRegion

Code: Select all

dc.SetClippingRegion(rect.x, rect.y, rect.GetWidth(), rect.GetHeight());
by silver.moon
Sun Jul 26, 2015 2:48 am
Forum: C++ Development
Topic: wxDC DrawLabel clip the text to the rectangle
Replies: 3
Views: 911

wxDC DrawLabel clip the text to the rectangle

Hi

I am drawing some text in a custom wxgridcellrenderer, using wxDC DrawLabel function

Code: Select all

dc.DrawLabel( text , rect, wxALIGN_TOP | wxALIGN_LEFT); 
If the text is wider than the rect, it overflows.
How to clip the text within the rect ?