Mercurial > dwindows
comparison dw.hpp @ 2899:425dc0126818
C++: Implement SplitBar and Dialog classes.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sat, 24 Dec 2022 01:43:38 +0000 |
parents | d53fee198085 |
children | fe31d4535270 |
comparison
equal
deleted
inserted
replaced
2898:d53fee198085 | 2899:425dc0126818 |
---|---|
1307 TreeExpandConnected = true; | 1307 TreeExpandConnected = true; |
1308 } | 1308 } |
1309 } | 1309 } |
1310 }; | 1310 }; |
1311 | 1311 |
1312 class SplitBar : public Widget | |
1313 { | |
1314 public: | |
1315 // Constructors | |
1316 SplitBar(int orient, Widget *topleft, Widget *bottomright, unsigned long id) { | |
1317 SetHWND(dw_splitbar_new(orient, topleft ? topleft->GetHWND() : DW_NOHWND, bottomright ? bottomright->GetHWND() : DW_NOHWND, id)); } | |
1318 SplitBar(int orient, Widget *topleft, Widget *bottomright) { | |
1319 SetHWND(dw_splitbar_new(orient, topleft ? topleft->GetHWND() : DW_NOHWND, bottomright ? bottomright->GetHWND() : DW_NOHWND, 0)); } | |
1320 | |
1321 // User functions | |
1322 float Get() { return dw_splitbar_get(hwnd); } | |
1323 void Set(float percent) { dw_splitbar_set(hwnd, percent); } | |
1324 }; | |
1325 | |
1326 class Dialog : public Handle | |
1327 { | |
1328 private: | |
1329 DWDialog *dialog; | |
1330 public: | |
1331 // Constructors | |
1332 Dialog(void *data) { dialog = dw_dialog_new(data); SetHandle(reinterpret_cast<void *>(dialog)); } | |
1333 Dialog() { dialog = dw_dialog_new(DW_NULL); SetHandle(reinterpret_cast<void *>(dialog)); } | |
1334 | |
1335 // User functions | |
1336 void *Wait() { void *retval = dw_dialog_wait(dialog); delete this; return retval; } | |
1337 int Dismiss(void *data) { return dw_dialog_dismiss(dialog, data); } | |
1338 int Dismiss() { return dw_dialog_dismiss(dialog, NULL); } | |
1339 }; | |
1312 | 1340 |
1313 class App | 1341 class App |
1314 { | 1342 { |
1315 protected: | 1343 protected: |
1316 App() { } | 1344 App() { } |