Search found 62 matches

by shawnee
Fri Oct 26, 2018 3:11 am
Forum: C++ Development
Topic: How to set font for one of toolbutton in wxToolbar?
Replies: 13
Views: 650

How to set font for one of toolbutton in wxToolbar?

Hi all, I want to set different font for one of toolbutton in wxToolbar. wxToolbar::SetFont() is not my desire, it will set the same font for all of toolbutton. wxToolBarToolBase * toolbutton = toolbar->FindById(toolid); assert(toolbutton != NULL); wxToolBarBase * toolsubwin = toolbutton->GetToolBar...
by shawnee
Mon Oct 15, 2018 1:37 am
Forum: C++ Development
Topic: Is there AddStretchableSpace like wxToolbar in wxRibbonBar?
Replies: 1
Views: 481

Is there AddStretchableSpace like wxToolbar in wxRibbonBar?

I'd like to put a panel in ribbonBar to the right side of page.
There is AddStretchableSpace method in wxToolbar, but wxRibbonBar is not?
Thanks!
by shawnee
Wed Oct 10, 2018 12:53 am
Forum: C++ Development
Topic: How to know the down-left coordinate of one of toolbutton in wxToolbar
Replies: 10
Views: 732

Re: How to know the down-left coordinate of one of toolbutton in wxToolbar

There is no function in the public API that does this. Under MSW, wx uses this helper function internally. It's not public, so you'd have to copy the code in order to use it. static RECT wxGetTBItemRect(HWND hwnd, int index, int id = wxID_NONE) { RECT r; // note that we use TB_GETITEMRECT and not T...
by shawnee
Wed Oct 10, 2018 12:52 am
Forum: C++ Development
Topic: How to know the down-left coordinate of one of toolbutton in wxToolbar
Replies: 10
Views: 732

Re: How to know the down-left coordinate of one of toolbutton in wxToolbar

PB wrote:Well, after looking at the wxToolBar API (and its MSW source), I believe it is not possible (unless using horrible hacks such as iterative calls to FindToolByPosition).
Yes, I didn't find it out, too. Thank you PB.
by shawnee
Tue Oct 09, 2018 2:16 am
Forum: C++ Development
Topic: How to know the down-left coordinate of one of toolbutton in wxToolbar
Replies: 10
Views: 732

Re: How to know the down-left coordinate of one of toolbutton in wxToolbar

Hi, You mean you want to distinguish between the left and right clicks? Thank you. No, I want to get the coordinate of clicked(left mouse) toolbutton, and I'm meant to popup a menu at the below of toolbutton with left alignment to toolbutton. dropdown style is not my desire, the reason I've said in...
by shawnee
Tue Oct 09, 2018 1:22 am
Forum: C++ Development
Topic: How to know the down-left coordinate of one of toolbutton in wxToolbar
Replies: 10
Views: 732

Re: How to know the down-left coordinate of one of toolbutton in wxToolbar

Catching the mouse clicking position is another way to get coordinate, but it can't always align the left of clicked toolbutton.
by shawnee
Tue Oct 09, 2018 12:59 am
Forum: C++ Development
Topic: How to know the down-left coordinate of one of toolbutton in wxToolbar
Replies: 10
Views: 732

Re: How to know the down-left coordinate of one of toolbutton in wxToolbar

Hi, What are you trying to do? What is the reason you need this? Can you show some code? Thank you. Oh, I just want to do some trick popup menu for one of clicked toolbutton. I know, there is dropdown menu style for toolbutton, but the bitmap button is also could be clicked. For my special purpose,...
by shawnee
Mon Oct 08, 2018 1:03 pm
Forum: C++ Development
Topic: How to know the down-left coordinate of one of toolbutton in wxToolbar
Replies: 10
Views: 732

How to know the down-left coordinate of one of toolbutton in wxToolbar

Hi,

I'm using wxToolbar. Id like to know the down-left coordinate of one of bitmap button in toolbar.
Is there somebody could help me? Thanks!
by shawnee
Sun Sep 30, 2018 2:11 pm
Forum: C++ Development
Topic: wxRibbonBar File Menu
Replies: 1
Views: 1475

Re: wxRibbonBar File Menu

Nice codes! I did slight modification on it. void MainFrame::RealizeRibbonCustomButtons(wxRibbonBar * pParentRibbon, const char * Label) { //@@preconditions assert(pParentRibbon != NULL); assert(Label != NULL && strlen(Label) > 0); //@@end preconditions wxRibbonArtProvider * artProvider = pParentRib...
by shawnee
Thu Sep 27, 2018 2:41 am
Forum: C++ Development
Topic: wxEVT_LIST_ITEM_SELECTED could not be triggered again if the item has been selected
Replies: 9
Views: 731

Re: wxEVT_LIST_ITEM_SELECTED could not be triggered again if the item has been selected

event.ShiftDown() https://docs.wxwidgets.org/trunk/classwx_keyboard_state.html If this does not work with a wxMouseEvent (although it should), use wxGetKeyState(): https://docs.wxwidgets.org/trunk/group__group__funcmacro__misc.html#ga82a18ac43492bfb375604c41b71ce84f event.ShiftDown() and event.Cont...
by shawnee
Wed Sep 26, 2018 6:01 am
Forum: C++ Development
Topic: wxEVT_LIST_ITEM_SELECTED could not be triggered again if the item has been selected
Replies: 9
Views: 731

Re: wxEVT_LIST_ITEM_SELECTED could not be triggered again if the item has been selected

Thanks doublemax, you always give us final professional answers!
I'd like ask you another question. If the listctrl is under Extended mode, how can I know the shift or ctrl key is pressing down when select item in list?
by shawnee
Wed Sep 26, 2018 3:49 am
Forum: C++ Development
Topic: wxEVT_LIST_ITEM_SELECTED could not be triggered again if the item has been selected
Replies: 9
Views: 731

Re: wxEVT_LIST_ITEM_SELECTED could not be triggered again if the item has been selected

The whole solve way is: this->mylist->Bind(wxEVT_LEFT_DOWN, &MyList::OnClickListItem, this, this->mylist->GetId()); this->mylist->Bind(wxEVT_LEFT_DCLICK, &MyList::OnClickListItem, this, this->mylist->GetId()); void MyList::OnClickListItem(wxMouseEvent& event) { int eventx = this->mylist->ScreenToCli...
by shawnee
Wed Sep 26, 2018 3:47 am
Forum: C++ Development
Topic: wxEVT_LIST_ITEM_SELECTED could not be triggered again if the item has been selected
Replies: 9
Views: 731

Re: wxEVT_LIST_ITEM_SELECTED could not be triggered again if the item has been selected

Oh, I got stupid, should be: this->mylist->SetItemState(row, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED) to select an item.
by shawnee
Wed Sep 26, 2018 1:14 am
Forum: C++ Development
Topic: wxEVT_LIST_ITEM_SELECTED could not be triggered again if the item has been selected
Replies: 9
Views: 731

Re: wxEVT_LIST_ITEM_SELECTED could not be triggered again if the item has been selected

even I set -- this->mylist->SetItemState(row, 1, wxLIST_STATE_SELECTED), it's still useless.
by shawnee
Wed Sep 26, 2018 1:12 am
Forum: C++ Development
Topic: wxEVT_LIST_ITEM_SELECTED could not be triggered again if the item has been selected
Replies: 9
Views: 731

Re: wxEVT_LIST_ITEM_SELECTED could not be triggered again if the item has been selected

If I change wxEVT_LEFT_UP to wxEVT_LEFT_DOWN, then I could get left button single clicking mouse event.
But I got a new problem, no highlight on selected item is showing. If response wxEVT_LEFT_UP, the highlight is showing.
Anybody could help me out? Thanks!