In this article, you will get an overview of the internal workings of DWinLib, a semi-simple wrapper for the Windows API.
|
#ifndef WinMainOH
#define WinMainOH
#include "DwlMainWin.h"
#include "DwlMdiClient.h"
#include "DwlGrinPtr.h"
#include "DwlTimer.h"
class ToolbarWin;
class ObjViewWin;
class ToolbarSettings;
class FlexiCharWrap;
class WinMainO : public DwlMainWin {
//Basic stuff
public:
WinMainO(LPSTR cmdStr, FlexiCharWrap * titleStr);
~WinMainO();
//DwlBaseWin overrides
public:
virtual LRESULT winProc(HWND window, UINT msg, WPARAM wParam, LPARAM lParam);
virtual LRESULT wClose();
virtual LRESULT wEraseBackground(HWND win, HDC dc) { return 0; }
virtual LRESULT wPosChanging(WINDOWPOS * windowPos);
virtual LRESULT wDestroyNonClientArea();
virtual LRESULT wNcActivate(BOOL activating, HWND deactivatedWin);
virtual LRESULT wEnable(BOOL enabled, HWND disabledWindow);
virtual LRESULT wPosChanged(WINDOWPOS * pos);
//For dealing with the application names:
private:
std::set<wString> appNamesC;
//Some other framework items used in this window
public:
void showStatusMessage(const wString & str);
MenuMain & mainMenu() { return * mainMenuC.get(); }
//A callback for the callback items:
private:
dwl::grin_ptr<DwlCallbackItem> deleteCallbackC;
dwl::grin_ptr<DwlCallbackItem> undoCallbackC;
dwl::grin_ptr<DwlCallbackItem> redoCallbackC;
dwl::grin_ptr<DwlCallbackItem> ctrlXcallbackC;
dwl::grin_ptr<DwlCallbackItem> newCompositionC;
dwl::grin_ptr<DwlCallbackItem> openCompositionC;
dwl::grin_ptr<DwlCallbackItem> saveCompositionC;
//For dealing with the toolbar and object view bar:
private:
dwl::grin_ptr<ToolbarSettings> toolbarSettingsC; //Deals w both toolbar & objViewBar
dwl::grin_ptr<ToolbarWin> toolbarC;
ToolbarWin * createToolbar();
dwl::grin_ptr<ObjViewWin> objViewWinC;
ObjViewWin * createObjView();
public:
ToolbarSettings * toolbarSettings() { return toolbarSettingsC.get(); }
//The following (releaseToolbar) is only called by the ToolbarWin wClose function.
void releaseToolbar();
ToolbarWin * toolbar() { return toolbarC.get(); }
void showToolbar(DwlWinObject *);
void releaseObjViewWin();
ObjViewWin * objViewWin() { return objViewWinC.get(); }
void showObjView(DwlWinObject *);
//Event handlers:
public:
void newWindow(DwlWinObject *);
void closeWindow(DwlWinObject *);
void closeAll(DwlWinObject *);
void open(DwlWinObject *);
void exit(DwlWinObject *);
void save(DwlWinObject *);
void saveAs(DwlWinObject *);
void undo(DwlWinObject *);
void redo(DwlWinObject *);
void play(DwlWinObject *);
void stop(DwlWinObject *);
void record(DwlWinObject *);
void deleteKeyPress(DwlWinObject *);
void ctrlXselection(DwlWinObject *);
//boolean for determining whether a file is currently being opened:
//(MEdit does not need this, but you may find it handy in your own app.)
private:
bool openingFileC;
public:
bool openingFile() { return openingFileC; }
//Other stuff
dwl::grin_ptr<DwlWinDialogs> dialogsC; //SHOULD THIS BE PRIVATE?????
public:
wString iniFileName();
void updateUI();
void updateDataAndViews();
Application * topApp();
void caption(wString str);
public:
void addAppName(const wString & perfName);
void removeAppName(const wString & appName);
void openMultiFiles(const wString & str);
void openFile(const wString & str);
//And for help:
public:
virtual LRESULT wHelp(HELPINFO * );
LRESULT help(int helpTopic = 1); //Default for any projects
//The following 'helpTopic' is used so that some modal windows can get appropriate
//help. See Port::portPatchFile for an example. It is important that those
//routines set it back to '1'
void helpTopic(int topic) { wHelpTopicC = topic; }
};
#endif
|
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.