Search found 67 matches

by shawnee
Thu Nov 15, 2018 12:52 pm
Forum: C++ Development
Topic: Is it possible to do drag&drop on toolbutton of wxToolBar?
Replies: 12
Views: 1264

Re: Is it possible to do drag&drop on toolbutton of wxToolBar?

As wxToolBar derives from wxWindow, it should work as a drop target (wxWindow::SetDropTarget). Then you could use wxToolBar::FindToolForPosition() to find the button where the drop happened. But i can't think of any way to start a drag from a toolbar button if a click on that button should also wor...
by shawnee
Thu Nov 15, 2018 3:24 am
Forum: C++ Development
Topic: Is it possible to do drag&drop on toolbutton of wxToolBar?
Replies: 12
Views: 1264

Is it possible to do drag&drop on toolbutton of wxToolBar?

Hi, All,

I'd like to do drag&drap on toolbutton. I want to drag a toolbutton and drop it to other window.
Can I do this? I checked document, it seems there is no drag&drop message event for wxToolBar.
Thanks!
by shawnee
Wed Oct 31, 2018 12:24 am
Forum: C++ Development
Topic: How to set font for one of toolbutton in wxToolbar?
Replies: 13
Views: 1167

Re: How to set font for one of toolbutton in wxToolbar?

Not sure is it really can to be done. What about method GetControl/1 ? Something like m_toolBar->FindControl(toolid)->SetFont(ft); but with all necessary checkings(on NULL). Though maybe it will work only for controls that was added via AddControl . Yes, you are right. it will work only for control...
by shawnee
Wed Oct 31, 2018 12:20 am
Forum: C++ Development
Topic: How to set font for one of toolbutton in wxToolbar?
Replies: 13
Views: 1167

Re: How to set font for one of toolbutton in wxToolbar?

Hi, Are you trying it for the button or some other control? Maybe you can cast it to the button and set the font this way? Something like this: wxToolBarToolBase * toolbutton = toolbar->FindById(toolid); assert(toolbutton != NULL); if( toolbutton.IsButton() ) { wxButton *button = (wxButton *) toolb...
by shawnee
Sat Oct 27, 2018 1:11 am
Forum: C++ Development
Topic: How to set font for one of toolbutton in wxToolbar?
Replies: 13
Views: 1167

Re: How to set font for one of toolbutton in wxToolbar?

ONEEYEMAN wrote:Hi,
Did you try:

Code: Select all

toolbutton->SetFont( ft );
Thank you.
no SetFont() member function for wxToolBarToolBase class. :-(
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: 1167

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: 574

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: 1059

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: 1059

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: 1059

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: 1059

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: 1059

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: 1059

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: 1615

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: 1066

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...