Search found 27 matches

by SalmonsSteve
Fri Apr 26, 2019 5:40 am
Forum: C++ Development
Topic: wxListItem background colour in wxListView
Replies: 3
Views: 794

Re: wxListItem background colour in wxListView

I'm not sure why "m_list->SetItemBackgroundColour(index,*wxWHITE);" doesn't work, but here's some code from the listctrl sample: wxListItem item; item.m_itemId = 0; item.SetTextColour(*wxRED); m_listCtrl->SetItem( item ); But this only works if the control is wxLC_REPORT mode. Sorry for t...
by SalmonsSteve
Wed Apr 24, 2019 4:42 am
Forum: C++ Development
Topic: wxComboBox indexing
Replies: 1
Views: 401

wxComboBox indexing

Every few years there is a need for the programs that I am working on to drop one or more item(s) from the available selection items in a combobox. In the past, when wxWidgets was not being utilized, the index of the item removed was reserved rather than re-used. So maybe in 1999 the available selec...
by SalmonsSteve
Wed Apr 24, 2019 3:56 am
Forum: C++ Development
Topic: wxListItem background colour in wxListView
Replies: 3
Views: 794

wxListItem background colour in wxListView

The wxListView adventure continues... I am trying to change the background colour of list items based on whether the panels they are associated with are active. I have tried a number of ways without success. I thought that the code below would work: void GUI::SetPanelState(long index, bool active) {...
by SalmonsSteve
Wed Apr 24, 2019 3:38 am
Forum: C++ Development
Topic: wxListView changing selected item
Replies: 5
Views: 1283

Re: wxListView changing selected item

Mouse events don't propagate upwards in the window hierarchy (only wxCommandEvents do). You need to bind the event handler directly to the control. E.g. from inside the MyFrame constructor: _lview->Bind(wxEVT_LEFT_DOWN, &MyFrame::OnLeftDown, this ); Funny, I had found this information right aft...
by SalmonsSteve
Tue Apr 23, 2019 1:31 am
Forum: C++ Development
Topic: wxListView changing selected item
Replies: 5
Views: 1283

Re: wxListView changing selected item

oddly enough I am unable to catch that event. I have EVT_LEFT_DOWN(GUI::ListClick) in my event table and I have a function "void GUI::ListClick(wxMouseEvent& evt)" defined and implemented. I put a break point in that function and the function is never entered. My coworker tried the sam...
by SalmonsSteve
Sun Apr 21, 2019 11:24 pm
Forum: C++ Development
Topic: wxListView changing selected item
Replies: 5
Views: 1283

Re: wxListView changing selected item

Thanks, doublemax! I'll give that a try. I got so consumed by the path I was going down I hadn't thought about dealing with it in any other way.
by SalmonsSteve
Sun Apr 21, 2019 5:11 pm
Forum: C++ Development
Topic: wxListView changing selected item
Replies: 5
Views: 1283

wxListView changing selected item

I am using a wxListView to toggle between a number of different panels. Some of the panels may not be active depending on values of other controls in the program. I have added appropriate members and methods to a class that holds the panel so I can determine if it is active. I have also written an e...
by SalmonsSteve
Fri Mar 08, 2019 2:14 am
Forum: C++ Development
Topic: Print header for wxWebView
Replies: 3
Views: 687

Re: Print header for wxWebView

Thank you, doublemax. I will take a look at that. Looking at this from another direction, and I'm sorry I haven't personally tried to implement this before the question, can a wxHtmlWindow be placed on a panel? I notice in the wxHtmlEasyPrinting class there are methods for setting the header and the...
by SalmonsSteve
Thu Mar 07, 2019 6:07 pm
Forum: C++ Development
Topic: Print header for wxWebView
Replies: 3
Views: 687

Print header for wxWebView

I have a wxWebView control on a panel displaying an html documented consisting primarily of pre-formatted text output created by a calculation dll. The output, when printed, is usually between 3 and 7 pages long. I want to put a header and a footer on each page but I'm really not sure how to do it. ...
by SalmonsSteve
Mon Feb 11, 2019 12:10 am
Forum: C++ Development
Topic: Custom events with/from wxComboBox and wxGrid
Replies: 7
Views: 1478

Re: Custom events with/from wxComboBox and wxGrid

Hi, Please consider using cell changing event for verification. It is bad practice to do the verification with every single key press and user usually will be confused when you display errors on every key press. Thank you. The cell changing event doesn't fire for wxGridCellChoiceEditor until the wx...
by SalmonsSteve
Sun Feb 10, 2019 11:39 pm
Forum: C++ Development
Topic: Custom events with/from wxComboBox and wxGrid
Replies: 7
Views: 1478

Re: Custom events with/from wxComboBox and wxGrid

I accomplished it with the following: in the .h #ifndef CUSTOM_GRID_H #define CUSTOM_GRID_H #include <vector> #include "wx/grid.h" wxDECLARE_EVENT(EVT_GRID_CHOICEEDITOR_CLOSED, wxGridEvent); class Custom_Grid : public wxGrid { public: Custom_Grid(wxWindow *parent, wxWindowID id, const wxPo...
by SalmonsSteve
Sun Feb 10, 2019 4:05 pm
Forum: C++ Development
Topic: Custom events with/from wxComboBox and wxGrid
Replies: 7
Views: 1478

Re: Custom events with/from wxComboBox and wxGrid

using the event handler macro EVT_GRID_CMD_CELL_CHANGING(GRID_ID, myFrame::ConcGridCellChanging) the function ConcGridCellChanging does not get hit until you click off of the GridCellChoiceEditor. I want to have the data stored without the cell having to lose focus. I would have thought the changing...
by SalmonsSteve
Sun Feb 10, 2019 3:18 pm
Forum: C++ Development
Topic: Custom events with/from wxComboBox and wxGrid
Replies: 7
Views: 1478

Custom events with/from wxComboBox and wxGrid

The problem I have recently run into is that when using a wxGridCellChoiceEditor I seem to be able to only catch 2 events, the cell changing event and the cell changed event. The cell changed event isn't emitted until the cell loses focus to another cell. I want to validate and store data when the c...
by SalmonsSteve
Sun Feb 10, 2019 2:48 pm
Forum: C++ Development
Topic: launch second application with a new thread
Replies: 10
Views: 1818

Re: launch second application with a new thread

Doublemax, thank you very much, adding the second parameter "this" to my calls to FindWindowById() fixed the issue and everything now works as expected.
by SalmonsSteve
Fri Feb 08, 2019 2:47 pm
Forum: C++ Development
Topic: launch second application with a new thread
Replies: 10
Views: 1818

Re: launch second application with a new thread

I can't believe I didn't look at the documentation for FindWindowById(), I'm normally pretty good about that stuff. So the easy rework would be to pass "this" to FindWindowById() since all controls exist and calls to FindWindowById() exist within the same class derived from wxFrame. There ...