Search found 307 matches

by New Pagodi
Thu Jun 06, 2019 3:11 pm
Forum: C++ Development
Topic: Button is focused when I run application
Replies: 9
Views: 245

Re: Button is focused when I run application

The only thing I can think of that should work on all platforms won't break the tab order is to add an extra hidden item and initially set the focus to it. For example, a frame with 4 buttons constructor might look like this: wxPanel* panel = new wxPanel(this); panel->Hide(); wxButton* button1 = new...
by New Pagodi
Mon Jun 03, 2019 5:15 am
Forum: C++ Development
Topic: Drawing transparent bitmap on panel
Replies: 8
Views: 6756

Re: Drawing transparent bitmap on panel

That's pretty much the classical job for a mask . With wxWidgets, you create a mask like this (assuming m_bmp is a wxBitmap member of the MyFrame class): MyFrame::MyFrame(...):wxFrame(...) { ... ::wxInitAllImageHandlers(); Bind(wxEVT_PAINT,&MyFrame::OnPaint,this); m_bmp = wxBitmap("test_sample.png",...
by New Pagodi
Thu May 23, 2019 7:42 pm
Forum: C++ Development
Topic: Static drawing on wxPanel(?)
Replies: 5
Views: 186

Re: Static drawing on wxPanel(?)

Try something like this: // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif // for all others, include the necessary headers (this file is usually all you // need because it includes almost all "standard" wxWidgets head...
by New Pagodi
Thu May 23, 2019 2:05 pm
Forum: Compiler / Linking / IDE Related
Topic: Ubuntu can't link wxStyledTextCtrl
Replies: 15
Views: 506

Re: Ubuntu can't link wxStyledTextCtrl

When linking statically, you also need to include the scintilla library (wxscintilla-3.0-x86_64-w64-mingw32.a based on the picture you posted above).
by New Pagodi
Wed May 22, 2019 3:04 pm
Forum: C++ Development
Topic: wxTextCtrl: Switching on the fly from wrap to hscroll
Replies: 12
Views: 416

Re: wxTextCtrl: Switching on the fly from wrap to hscroll

rocrail wrote:
Wed May 22, 2019 2:33 pm
Since which wxWidgets Version is this control available? 3.0?
I'm not sure when it was added, but I was recently looking at commits from 2004, so it's been in for a long time.
by New Pagodi
Wed May 22, 2019 3:03 pm
Forum: C++ Development
Topic: wxTextCtrl: Switching on the fly from wrap to hscroll
Replies: 12
Views: 416

Re: wxTextCtrl: Switching on the fly from wrap to hscroll

You need to change

Code: Select all

`wx-config --libs std,aui`
to

Code: Select all

`wx-config --libs std,aui,stc`
by New Pagodi
Tue May 21, 2019 3:31 pm
Forum: C++ Development
Topic: wxTextCtrl: Switching on the fly from wrap to hscroll
Replies: 12
Views: 416

Re: wxTextCtrl: Switching on the fly from wrap to hscroll

Hi, OK, but what purpose has the SetWindowStyleFlag function if it has more or less no effect? In fairness, the documentation does state: Please note that some styles cannot be changed after the window creation and that Refresh() might need to be called after changing the others for the change to t...
by New Pagodi
Mon May 13, 2019 11:40 am
Forum: C++ Development
Topic: GetCaret()->Hide() makes the app crash at start-up
Replies: 3
Views: 150

Re: GetCaret()->Hide() makes the app crash at start-up

If you want to hide the caret in a styled text control, you should probably call

Code: Select all

SetCaretStyle(wxSTC_CARETSTYLE_INVISIBLE)
on the stc object.
by New Pagodi
Sat Apr 20, 2019 4:09 pm
Forum: C++ Development
Topic: Read access violation when closing my app
Replies: 5
Views: 238

Re: Read access violation when closing my app

On the page for wxTopLevelWindow, they state
Note that the instances of wxTopLevelWindow are managed by wxWidgets in the internal top level window list.
by New Pagodi
Fri Apr 19, 2019 1:34 am
Forum: C++ Development
Topic: Read access violation when closing my app
Replies: 5
Views: 238

Re: Read access violation when closing my app

You don't need to delete mainWindow. As part of application termination, wxWidgets destroys all top level widows.
by New Pagodi
Mon Apr 15, 2019 2:30 pm
Forum: C++ Development
Topic: example for modal progress bar
Replies: 4
Views: 212

Re: example for modal progress bar

The dialogs sample is in the samples folder that comes with the wxWidgets library - specifically in the folder <WXROOT>/samples/dialogs. If you're using a separate worker thread, it's very important that you never call gui methods from the secondary thread. So you'll have to update the progress dial...
by New Pagodi
Mon Apr 15, 2019 2:05 pm
Forum: C++ Development
Topic: example for modal progress bar
Replies: 4
Views: 212

Re: example for modal progress bar

It sounds like what you want is the wxProgressDialog class. There is a short example this page and larger example in the dialogs sample.
by New Pagodi
Thu Apr 11, 2019 12:36 am
Forum: C++ Development
Topic: how to hide a complex wxDialog's slow first render?
Replies: 2
Views: 158

Re: how to hide a complex wxDialog's slow first render?

The usual way to do this is to to create is to create an initially hidden panel, add all the controls to it, and then show the panel. You might want to also consider using a property grid. That way you can group things in logical categories and it would probably offer a less crowded interface for th...
by New Pagodi
Tue Apr 09, 2019 12:23 am
Forum: C++ Development
Topic: wxString to const char*
Replies: 1
Views: 99

Re: wxString to const char*

If you're using 3.0 or later, wxString can be implicitly cast to const char*. So you can just do:

Code: Select all

f(str);
If the string contains only ascii characters, that's the easiest thing to do.