2015-02-25 01:02 PM - last edited on 2023-08-01 01:50 PM by Doreena Deng
'GDLG' 32511 Modal 0 0 444 174 "Upload IFC" { /* [ 1] */ NormalTab 0 0 428 148 32512 NoIcon "New" 32513 NoIcon "Existing" /* [ 2] */ Button 260 106 75 23 LargePlain "Cancel" /* [ 3] */ Button 341 106 75 23 LargePlain "Upload" } 'DLGH' 32511 DLG_32511_Upload_IFC { 1 "" uploadTabControl 2 "" btnUpload 3 "" btnCancel } 'GDLG' 32512 TabPage 0 0 428 100 "" { /* [ 4] */ LeftText 13 23 84 13 LargePlain "Model file name:" /* [ 5] */ TextEdit 104 18 293 20 LargePlain 256 /* [ 6] */ Separator 13 53 385 1 } 'DLGH' 32512 TabPage_32512 { 4 "" lblModelName_New 5 "" txtModelName 6 "" seperator_2 } 'GDLG' 32513 TabPage 0 0 428 100 "" { /* [ 7] */ LeftText 13 23 84 13 LargePlain "Model file name:" /* [ 8] */ PopupControl 104 18 293 20 144 0 /* [ 9] */ Separator 13 53 385 1 } 'DLGH' 32513 TabPage_32512 { 7 "" lblModelName_Existing 8 "" comboModelName 9 "" seperator_2 }ExportDialog.h
#define IID_EXPORT 32511 #define IDT_NORMALTAB 1 #define IDB_BTN_CANCEL 2 #define IDB_BTN_UPLOAD 3 #define IDT_MODELNAME 5 #define IDC_EXISTING_MODEL 8 class ExportDialog : public DG::ModalDialog { friend class TabControlObserver; private: DG::NormalTab m_TabControl; DG::TextEdit m_txtModelName; DG::Button m_btnCancel; DG::Button m_btnSave; DG::PopUp m_comboModelName; TabControlObserver *tabControl; public: ExportDialog(); ~ExportDialog(); private: protected: private: ExportDialog(const ExportDialog&); const ExportDialog& operator=(const ExportDialog&); //Disabled }; // ----------------------------------------------- TabControlObserver ----------------------------------------------- class TabControlObserver : public DG::PanelObserver, public DG::NormalTabObserver, public DG::ButtonItemObserver, public DG::CompoundItemObserver { private: ExportDialog* mDialog; protected: // DG::PanelObserver virtual void PanelOpened (const DG::PanelOpenEvent& ev) override; // DG::ButtonItemObserver virtual void ButtonClicked (const DG::ButtonClickEvent& ev) override; public: explicit TabControlObserver (ExportDialog* mainDialog); ~TabControlObserver (); };ExportDialog.cpp
ExportDialog::ExportDialog() : ModalDialog (ACAPI_GetOwnResModule (), IID_EXPORT, InvalidResModule), m_TabControl(GetReference (), IDT_NORMALTAB), m_txtModelName(GetReference (), IDT_MODELNAME), m_btnCancel(GetReference (), IDB_BTN_CANCEL), m_btnSave(GetReference (), IDB_BTN_UPLOAD), m_comboModelName(GetReference (), IDC_EXISTING_MODEL) { tabControl = new TabControlObserver(this); m_TabControl.Attach(*tabControl); } ExportDialog::~ExportDialog() { //delete tabControl; } //-------------------------- Class TabControlObserver ----------------------- TabControlObserver::TabControlObserver (ExportDialog* mainDialog): mDialog (mainDialog) { mDialog->Attach (*this); AttachToAllItems (*mDialog); } TabControlObserver::~TabControlObserver () { mDialog->Detach (*this); DetachFromAllItems (*mDialog); } void TabControlObserver::PanelOpened (const DG::PanelOpenEvent& /*ev*/) { mDialog->SetClientSize (mDialog->GetOriginalClientWidth (), mDialog->GetOriginalClientHeight ()); mDialog->m_TabControl.SetClientSize(mDialog->GetOriginalClientWidth (),(mDialog->GetOriginalClientHeight () / 2) - mDialog->m_btnCancel.GetHeight()); } void TabControlObserver::ButtonClicked (const DG::ButtonClickEvent& ev) { // Close dialog with acceptance if (ev.GetSource () == &mDialog->m_btnCancel) { mDialog->PostCloseRequest (DG::ModalDialog::Accept); } else if ( ev.GetSource() == &mDialog->m_btnSave ) { //here I need to get mDialog->m_txtModelName text GS::UniString temp = mDialog->m_txtModelName.GetText(); // this value always comes empty } }My goal is to get mDialog->m_txtModelName information in ButtonClicked function.
2015-02-25 01:48 PM
'GDLG' 32511 Modal 0 0 444 174 "Upload IFC" { /* [ 1] */ NormalTab 0 0 428 148 32512 NoIcon "New" 32513 NoIcon "Existing" /* [ 2] */ Button 260 106 75 23 LargePlain "Cancel" /* [ 3] */ Button 341 106 75 23 LargePlain "Upload" } 'DLGH' 32511 DLG_32511_Upload_IFC { 1 "" uploadTabControl 2 "" btnUpload 3 "" btnCancel } 'GDLG' 32512 TabPage 0 0 428 100 "" { /* [ 1] */ LeftText 13 23 84 13 LargePlain "Model file name:" /* [ 2] */ TextEdit 104 18 293 20 LargePlain 256 /* [ 3] */ Separator 13 53 385 1 } 'DLGH' 32512 TabPage_32512 { 1 "" lblModelName_New 2 "" txtModelName 3 "" seperator_2 } 'GDLG' 32513 TabPage 0 0 428 100 "" { /* [ 1] */ LeftText 13 23 84 13 LargePlain "Model file name:" /* [ 2] */ PopupControl 104 18 293 20 144 0 /* [ 3] */ Separator 13 53 385 1 } 'DLGH' 32513 TabPage_32513 { 1 "" lblModelName_Existing 2 "" comboModelName 3 "" seperator_2 }
2015-02-25 04:26 PM
2015-02-25 04:44 PM
ggiloyan wrote:
is it correct to have two control with the same ID in a class?