- xonorptrs_demo.zip
- SPointers
- res
- cur00001.cur
- cur00002.cur
- cur00003.cur
- cur00004.cur
- cur00005.cur
- cur00006.cur
- cur00007.cur
- cursor1.cur
- cursor2.cur
- mainfram.bmp
- SPointers.ico
- toolbar.bmp
- toolbar1.bmp
- SPointers.sln
- SPointers
- XonorPtrs..dgm
- xonorptrs_src.zip
- XonorPtrs_Src
|
// MainDlg.h : interface of the CObjectDlg class
//
/////////////////////////////////////////////////////////////////////////////
#pragma once
using namespace XonorPtrs;
using namespace visual_objects;
class CObjectDlg : public CDialogImpl<CObjectDlg>,
public enable_self_delete<CObjectDlg>
{
public:
enum { IDD = IDD_OBJECT };
ref<CVisualObject> m_rVisualObject;
ref<CDocument> m_rDocument;
CObjectDlg(owner_ptr<CObjectDlg>const& Owner, ref<CDocument> rDocument)
:enable_self_delete(Owner)
{
m_rDocument=rDocument;
}
~CObjectDlg()
{
if(this->IsWindow())
DestroyWindow();
m_hWnd=NULL;
}
virtual void OnFinalMessage(HWND hWnd )
{
SetMsgHandled(FALSE);
self_delete();
}
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
//OnInitDialog code goes here
CenterWindow();
return TRUE;
}
LRESULT OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
// TODO: Add validation code
WriteCurrentObject();
CloseDialog(wID);
return 0;
}
LRESULT OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
CloseDialog(wID);
return 0;
}
void WriteCurrentObject()
{
if(m_rVisualObject)
{
GetDlgItem(IDC_EDIT1).GetWindowText(m_rVisualObject->m_csText);
m_rDocument->RePaintObject(m_rVisualObject);
}
}
void CloseDialog(int nVal)
{
DestroyWindow();
}
LRESULT OnFont(UINT uiVar, int iVar, HWND hWnd)
{
CFontDialog Dlg;
if(m_rVisualObject && m_rVisualObject->m_spFont!=NULL)
m_rVisualObject->m_spFont->m_Font.GetLogFont(&Dlg.m_lf);
Dlg.m_cf.rgbColors=m_rVisualObject->m_TextColor;
Dlg.DoModal();
m_rVisualObject->m_spFont=m_rDocument->m_FontPool.GetLoadedFont(Dlg.m_lf);
m_rVisualObject->m_TextColor=Dlg.m_cf.rgbColors;
m_rDocument->RePaintObject(m_rVisualObject);
return 0;
}
LRESULT OnCommit(UINT uiVar, int iVar, HWND hWnd)
{
WriteCurrentObject();
return 0;
}
BEGIN_EX_MSG_MAP(CObjectDlg)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
COMMAND_ID_HANDLER(IDOK, OnOK)
COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
COMMAND_ID_HANDLER_EX(IDC_FONT, OnFont)
COMMAND_ID_HANDLER_EX(IDC_COMMIT, OnCommit)
END_MSG_MAP()
};
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Software Author with engineering, science and mathematical background.
Many years using C++ to develop responsive visualisations of fine grained dynamic information largely in the fields of public transport and supply logistics. Currently interested in what can be done to make the use of C++ cleaner, safer, and more comfortable.