Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef XAP_Win32DialogHelper_H
00023 #define XAP_Win32DialogHelper_H
00024
00025
00026
00027 #ifdef _MSC_VER
00028 #pragma warning(disable: 4355)
00029 #endif
00030
00031 #include <commctrl.h>
00032
00033
00034 #include "xap_Frame.h"
00035 #include "xap_Win32FrameImpl.h"
00036 #include "ut_Xpm2Bmp.h"
00037
00038 class ABI_EXPORT XAP_Win32Dialog
00039 {
00040 public:
00041 virtual BOOL _onInitDialog(HWND hWnd, WPARAM wParam, LPARAM lParam) = 0;
00042 virtual BOOL _onCommand(HWND hWnd, WPARAM wParam, LPARAM lParam) = 0;
00043 virtual BOOL _onDeltaPos(NM_UPDOWN * pnmud) = 0;
00044 };
00045
00046 class ABI_EXPORT XAP_Win32DialogHelper
00047 {
00048 public:
00049 XAP_Win32DialogHelper(XAP_Win32Dialog* p_dialog)
00050 : m_pDialog(p_dialog),
00051 m_hDlg(0)
00052 {
00053 }
00054
00055
00056
00057
00058 XAP_Win32DialogHelper(HWND hDlg)
00059 : m_pDialog(0),
00060 m_hDlg(hDlg)
00061 {
00062 }
00063
00064
00065 public:
00066
00067 void runModal( XAP_Frame* pFrame,
00068 XAP_Dialog_Id dialog_id,
00069 UT_sint32 resource_id,
00070 XAP_Dialog* p_dialog);
00071
00072 void runModeless( XAP_Frame* pFrame,
00073 XAP_Dialog_Id dialog_id,
00074 UT_sint32 resource_id,
00075 XAP_Dialog_Modeless* p_dialog);
00076
00077 static BOOL CALLBACK s_dlgProc( HWND hWnd,
00078 UINT msg,
00079 WPARAM wParam,
00080 LPARAM lParam);
00081
00082 void checkButton(UT_sint32 controlId, bool bChecked = true);
00083 void enableControl(UT_sint32 controlId, bool bEnabled = true);
00084 void destroyWindow();
00085 void setDialogTitle(LPCSTR p_str);
00086 int showWindow( int Mode );
00087 int showControl(UT_sint32 controlId, int Mode);
00088 int bringWindowToTop();
00089
00090
00091
00092 int addItemToCombo(UT_sint32 controlId, LPCSTR p_str);
00093 void selectComboItem(UT_sint32 controlId, int index);
00094 int setComboDataItem(UT_sint32 controlId, int nIndex, DWORD dwData);
00095 int getComboDataItem(UT_sint32 controlId, int nIndex);
00096 int getComboSelectedIndex(UT_sint32 controlId) const;
00097 void resetComboContent(UT_sint32 controlId);
00098
00099
00100
00101 void resetContent(UT_sint32 controlId);
00102 int addItemToList(UT_sint32 controlId, LPCSTR p_str);
00103 int getListSelectedIndex(UT_sint32 controlId) const;
00104 int setListDataItem(UT_sint32 controlId, int nIndex, DWORD dwData);
00105 int getListDataItem(UT_sint32 controlId, int nIndex);
00106 void selectListItem(UT_sint32 controlId, int index);
00107 void getListText(UT_sint32 controlId, int index, char *p_str) const;
00108
00109
00110 void setControlText(UT_sint32 controlId, LPCSTR p_str);
00111 void setControlInt(UT_sint32 controlId, int value);
00112 int getControlInt(UT_sint32 controlId) const;
00113
00114 void selectControlText(UT_sint32 controlId,
00115 UT_sint32 start,
00116 UT_sint32 end);
00117
00118 int isChecked(UT_sint32 controlId) const;
00119 void getControlText( UT_sint32 controlId,
00120 LPSTR p_buffer,
00121 UT_sint32 Buffer_length) const;
00122
00123 bool isControlVisible(UT_sint32 controlId) const;
00124
00125 bool isParentFrame( XAP_Frame& frame) const;
00126 void setParentFrame(const XAP_Frame* pFrame);
00127 XAP_Frame* getParentFrame();
00128 void centerDialog();
00129 static void s_centerDialog(HWND hWnd);
00130 void setHandle(HWND hWnd){m_hDlg=hWnd;};
00131
00132 private:
00133 XAP_Win32Dialog * m_pDialog;
00134 HWND m_hDlg;
00135 };
00136
00137
00138 #endif