# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1672532619 0 # Node ID ebbc5b16899eb38ee60d217cca119ce051be6bb9 # Parent 1184f58135bacf59fa720e7fda9b057b97a04afe C++: Another couple fixes, context menus and PackAtIndex that got lost during porting. diff -r 1184f58135ba -r ebbc5b16899e dw.hpp --- a/dw.hpp Sat Dec 31 21:42:12 2022 +0000 +++ b/dw.hpp Sun Jan 01 00:23:39 2023 +0000 @@ -351,6 +351,7 @@ int Lower() { return dw_window_lower(hwnd); } void Redraw() { dw_window_redraw(hwnd); } void Default(Widget *defaultitem) { if(defaultitem) dw_window_default(hwnd, defaultitem->GetHWND()); } + void ClickDefault(Widget *defaultitem) { if(defaultitem) dw_window_click_default(hwnd, defaultitem->GetHWND()); } void SetIcon(HICN icon) { dw_window_set_icon(hwnd, icon); } MenuBar *MenuBarNew() { if(!menu) menu = new MenuBar(hwnd); return menu; } void Popup(Menu *menu, int x, int y) { @@ -1437,7 +1438,7 @@ return classptr->_ConnectItemSelectOld(classptr, item, text, itemdata); return classptr->OnItemSelect(item, text, itemdata); } - static int _OnItemContext(HWND window, char *text, int x, int y, void *itemdata, void *data) { + static int _OnItemContext(HWND window, char *text, int x, int y, void *data, void *itemdata) { ObjectView *classptr = reinterpret_cast(data); #ifdef DW_LAMBDA if(classptr->_ConnectItemContext) diff -r 1184f58135ba -r ebbc5b16899e dwtestoo.cpp --- a/dwtestoo.cpp Sat Dec 31 21:42:12 2022 +0000 +++ b/dwtestoo.cpp Sun Jan 01 00:23:39 2023 +0000 @@ -351,7 +351,7 @@ // Request that the render widgets redraw... // If not using direct rendering, call UpdateRender() to // redraw the in memory pixmaps. Then trigger the expose events. - // Expose will call update_render() to draw directly or bitblt the pixmaps. + // Expose will call UpdateRender() to draw directly or bitblt the pixmaps. void RenderDraw() { // If we are double buffered, draw to the pixmaps if(render_type != SHAPES_DIRECT) @@ -704,10 +704,10 @@ cancelbutton->Unpack(); buttonbox->PackStart(cancelbutton, 130, 30, TRUE, TRUE, 2); - //this->ClickDefault(cancelbutton); + this->ClickDefault(cancelbutton); DW::Button *colorchoosebutton = new DW::Button("Color Chooser Dialog"); - buttonbox->PackStart(colorchoosebutton, 130, 30, TRUE, TRUE, 2); + buttonbox->PackAtIndex(colorchoosebutton, 1, 130, 30, TRUE, TRUE, 2); // Set some nice fonts and colors lbbox->SetColor(DW_CLR_DARKCYAN, DW_CLR_PALEGRAY);