Search found 32 matches

by rando
Thu Jan 30, 2020 4:14 pm
Forum: C++ Development
Topic: wxGridCellTextEditor::GetValue() nullptr exception
Replies: 3
Views: 188

Re: wxGridCellTextEditor::GetValue() nullptr exception

When I get some time I will research how to properly post to the list/file bug report, right now this gets the info out there in case anyone else runs into the same problem.
Thank you for the heads up.
by rando
Thu Jan 30, 2020 1:50 pm
Forum: C++ Development
Topic: wxGridCellTextEditor::GetValue() nullptr exception
Replies: 3
Views: 188

wxGridCellTextEditor::GetValue() nullptr exception

src/generic/grideditors.cpp, starting at line 664 has the offending function which does not contain a nullptr check on the pointer returned from Text(). // return the value in the text control wxString wxGridCellTextEditor::GetValue() const { return Text()->GetValue(); } I have custom tabbing which ...
by rando
Wed Jun 19, 2019 9:13 pm
Forum: C++ Development
Topic: wxAuiToolBar - delete separator
Replies: 7
Views: 292

Re: wxAuiToolBar - delete separator

I wonder if GetToolCount() would work for you, store the highest index before you add anything then DeleteByIndex() all of the items after that one when you are ready to remove the added tools. That is assuming you always add/remove from the end. DeleteByIndex(int tool_id) I think is actually Delete...
by rando
Wed Jun 19, 2019 5:38 pm
Forum: C++ Development
Topic: How change wxAuiManager behaviour?
Replies: 4
Views: 227

Re: How change wxAuiManager behaviour?

Your best bet for understanding is to change those flags, recompile, and see how the layout changes.
Change wxLEFT to wxRIGHT, compile and see how it looks.
Change wxBOTTOM to wxTOP, compile, and see how it looks.
... and so on.
by rando
Wed Jun 19, 2019 5:34 pm
Forum: C++ Development
Topic: wxAuiToolBar - delete separator
Replies: 7
Views: 292

Re: wxAuiToolBar - delete separator

I usually clear the complete toolbar then rebuild it with the needed tools and layout as required. You can have a function to do that with an enum argument that lists your various layouts. Doing it that way produces easier to read and modify code down the road.
by rando
Wed Jun 19, 2019 4:13 pm
Forum: C++ Development
Topic: wxAuiToolBar - delete separator
Replies: 7
Views: 292

Re: wxAuiToolBar - delete separator

There are DeleteTool() and DeleteByIndex() functions.
Read the docs: https://docs.wxwidgets.org/3.1.2/classw ... 7ddca4517d
by rando
Wed Jun 19, 2019 4:05 pm
Forum: C++ Development
Topic: How change wxAuiManager behaviour?
Replies: 4
Views: 227

Re: How change wxAuiManager behaviour?

I am not sure exactly what you mean but the code to position the panes is // add the panes to the manager m_mgr.AddPane(text1, wxLEFT, wxT("Pane Number One")); m_mgr.AddPane(text2, wxBOTTOM, wxT("Pane Number Two")); m_mgr.AddPane(text3, wxCENTER); The panes are positioned with the wxLEFT, wxBOTTOM, ...
by rando
Tue Apr 09, 2019 12:23 pm
Forum: C++ Development
Topic: wxAui - remove pane border
Replies: 13
Views: 6360

Re: wxAui - remove pane border

It also works to put the code in the constructor of a wxAuiNotebook derived class #include "wx/aui/aui.h" // This is the only include needed (I am using wx 3.1.x) AuiNotebookDerivedConstructor(...) { /* Remove border drawn by the wxAuiDefaultDockArt that wxAuiManager uses internally*/ wxAuiManager* ...
by rando
Wed Jan 30, 2019 6:14 pm
Forum: C++ Development
Topic: Sizer's question
Replies: 3
Views: 302

Re: Sizer's question

Sure you can, just Hide()the current page, call Remove() on it, then call Add() on the other page and Show().
I often keep "stacks" of hidden windows and swap them in/out of notebook pages as needed.
by rando
Wed Jan 30, 2019 3:55 pm
Forum: C++ Development
Topic: Sizer's question
Replies: 3
Views: 302

Re: Sizer's question

Is it possible to change a sizer's flags after the creation of a sizer? Say I wanted a horizontal BoxSizer to expand only under certain circumstances, or wanted to add and remove the wxRESERVE_SPACE_EVEN_IF_HIDDEN flag? I am not sure about the wxRESERVE_SPACE_EVENT_IF_HIDDEN flag but you can certai...
by rando
Wed Jan 30, 2019 3:30 pm
Forum: C++ Development
Topic: wxRadioBox without default selection
Replies: 3
Views: 273

Re: wxRadioBox without default selection

From the wxRadioBox docs virtual void wxRadioBox::SetSelection ( int n ) Sets the selection to the given item. Notice that a radio box always has selection , so n must be valid here and passing wxNOT_FOUND is not allowed. So to answer your question specifically for the wxRadioBox: You must have a se...
by rando
Wed Jan 30, 2019 3:17 pm
Forum: Platform Related Issues
Topic: Widgets look flat in wxFormbuilder, but not when compiled in IDE
Replies: 11
Views: 1144

Re: Widgets look flat in wxFormbuilder, but not when compiled in IDE

Do the buttons in your compiled application appear the same as buttons in other Windows applications? wxWidgets uses the windows theme by default. I am not aware of any workaround except to use wxUniversal which draws its own controls. If you are willing to make bitmaps for all of your buttons and t...
by rando
Thu Jan 24, 2019 8:45 pm
Forum: C++ Development
Topic: wxMemoryDC on wxBitmap uses button background/foreground
Replies: 10
Views: 996

Re: wxMemoryDC on wxBitmap uses button background/foreground

Ok, I gave up on figuring out what is happening and instead just pasted PB's code into a function and then adapted it minimally to work with the flow I have designed. The following is what I came up with. Thanks for the help PB! bool DrawLabelOnBitmapButton( wxButton* button, const wxString& label, ...
by rando
Thu Jan 24, 2019 1:28 pm
Forum: C++ Development
Topic: wxMemoryDC on wxBitmap uses button background/foreground
Replies: 10
Views: 996

Re: wxMemoryDC on wxBitmap uses button background/foreground

Sorry! I should have shown my button creation code wxButton( collapsible_pane_panel, wxID_ANY, _("UNIFORM"), wxDefaultPosition, wxDefaultSize, wxBORDER_NONE|wxBU_NOTEXT); wxBORDER_NONE removes the border then I set the button background to the same as the parent (which is usually black but I have co...
by rando
Wed Jan 23, 2019 9:37 pm
Forum: C++ Development
Topic: wxMemoryDC on wxBitmap uses button background/foreground
Replies: 10
Views: 996

Re: wxMemoryDC on wxBitmap uses button background/foreground

Finally getting back to this. First a little relevant background. I have been using wxWidgets since version 2.6. I develop industrial and laboratory interfaces for our test equipment. Those interfaces are as simple as possible, all the magic occurs on the back-end and the major work is in communicat...