SOLVED!
ButtonClicked function do not work.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-07-10
09:43 AM
- last edited on
2021-09-15
11:58 AM
by
Noemi Balogh
2020-07-10
09:43 AM
Dear developers,
I finished writing UI resource code.
But event handle working has difficult now.
Next code is current working.
In the ButtonClicked function,
if (ev.GetSource () == &btn_OK) {
These codes are not working.
}
Could you answer me about the cause?
Environment : Windows 7 64Bit, ArchiCAD 19, API v19
I finished writing UI resource code.
But event handle working has difficult now.
Next code is current working.
In the ButtonClicked function,
if (ev.GetSource () == &btn_OK) {
}
Could you answer me about the cause?
Environment : Windows 7 64Bit, ArchiCAD 19, API v19
class placeEuroformDialog : public DG::ModalDialog, public DG::ButtonItemObserver, public DG::CompoundItemObserver { protected: enum Controls { ButtonID = 1, GroupboxID = 2, LeftTextID = 3, IntEditID = 4, PopupControlID = 5 }; DG::Button btn_OK; DG::Button btn_Cancel; DG::GroupBox grp_placeCnt; DG::GroupBox grp_euroformOptions; DG::LeftText lbl_horCnt; DG::LeftText lbl_verCnt; DG::LeftText lbl_wid; DG::LeftText lbl_hei; DG::LeftText lbl_ori; DG::LeftText lbl_inst; DG::IntEdit edt_horCnt; DG::IntEdit edt_verCnt; DG::PopUp popup_wid; DG::PopUp popup_hei; DG::PopUp popup_ori; DG::PopUp popup_inst; virtual void ButtonClicked (const DG::ButtonClickEvent& ev) override; public: placeEuroformDialog (); ~placeEuroformDialog (); }; placeEuroformDialog::placeEuroformDialog () : DG::ModalDialog (ACAPI_GetOwnResModule (), 32600, ACAPI_GetOwnResModule ()), btn_OK (GetReference (), ButtonID), btn_Cancel (GetReference (), ButtonID), grp_placeCnt (GetReference (), GroupboxID), grp_euroformOptions (GetReference (), GroupboxID), lbl_horCnt (GetReference (), LeftTextID), lbl_verCnt (GetReference (), LeftTextID), lbl_wid (GetReference (), LeftTextID), lbl_hei (GetReference (), LeftTextID), lbl_ori (GetReference (), LeftTextID), lbl_inst (GetReference (), LeftTextID), edt_horCnt (GetReference (), IntEditID), edt_verCnt (GetReference (), IntEditID), popup_wid (GetReference (), PopupControlID), popup_hei (GetReference (), PopupControlID), popup_ori (GetReference (), PopupControlID), popup_inst (GetReference (), PopupControlID) { AttachToAllItems (*this); } placeEuroformDialog::~placeEuroformDialog () { DetachFromAllItems (*this); } void placeEuroformDialog::ButtonClicked (const DG::ButtonClickEvent& ev) { ACAPI_WriteReport ("This message is show.", true); if (ev.GetSource () == &btn_OK) { ACAPI_WriteReport ("OK Button... This message is not show.", true); PostCloseRequest (Accept); } } ... GSErrCode placeEuroform (void) { placeEuroformDialog dialog; dialog.Invoke (); return NoError; } ... GSErrCode __ACENV_CALL MenuCommandHandler (const API_MenuParams *menuParams) { GSErrCode err = NoError; switch (menuParams->menuItemRef.menuResID) { case 32500: switch (menuParams->menuItemRef.itemIndex) { case 1: err = placeEuroform (); break; } break; } return err; } // CommandHandler ()
Solved! Go to Solution.
Labels:
- Labels:
-
Add-On (C++)
1 ACCEPTED SOLUTION
Accepted Solutions
Solution

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-07-11 12:44 PM
2020-07-11
12:44 PM
ButtonID = 1,
btn_OK (GetReference (), ButtonID), btn_Cancel (GetReference (), ButtonID),
Each control must have a unique number (ID) exactly equal to the position in the 'GDLG' resource.
2 REPLIES 2
Solution

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-07-11 12:44 PM
2020-07-11
12:44 PM
ButtonID = 1,
btn_OK (GetReference (), ButtonID), btn_Cancel (GetReference (), ButtonID),
Each control must have a unique number (ID) exactly equal to the position in the 'GDLG' resource.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-07-13 02:31 AM
2020-07-13
02:31 AM
Dear Oleg,
Your answer is exactly right.
My source code did not have "unique" ID.
After fixed code, my code works well.
Thank you, Oleg.
Your answer is exactly right.
My source code did not have "unique" ID.
After fixed code, my code works well.
Thank you, Oleg.