In this article, you will get an overview of the internal workings of DWinLib, a semi-simple wrapper for the Windows API.
|
#ifndef AppWindowH
#define AppWindowH
#include "DwlMdiBaseWin.h"
#include "DwlGrinPtr.h"
class Application;
#include "DwlBlankChild.h" //SHOULD NOT NEED!
class DwlScrollbar;
class AppWinKeeper;
//class AppWindow;
const int SLW = 700; //Screen Length Width
class AppWindow : public DwlMdiBaseWin {
//General stuff
private:
dwl::grin_ptr<Application> appC;
dwl::grin_ptr<DwlScrollbar> horScrollC;
dwl::grin_ptr<DwlScrollbar> verScrollC;
public:
AppWindow(DwlControl * parent, int x, int y, int width, int height, bool openingFile=false);
~AppWindow();
LRESULT wClose();
virtual LRESULT wEraseBackground(HWND win, HDC dc) { return 0; }
virtual LRESULT wPaint(DwlDC & wdc);
virtual LRESULT wPosChanged(WINDOWPOS * windowPos);
virtual LRESULT wPosChanging(WINDOWPOS * wp);
Application & app() { return *appC; }
void update() { }
void updateDataAndViews();
//For dealing with the name:
public:
virtual wString shortName();
virtual wString fullName();
//virtual LRESULT wMdiActivate(HWND activatingWindow, HWND deactivatingWindow);
//For dealing with closing. Overridden from DwlMdiBaseWin.
public:
virtual bool canClose();
//For the scrollbars:
public:
void updateScrolls();
virtual LRESULT wScrollHor(WORD scrollCode, int pos, HWND scrollHwnd);
virtual LRESULT wScrollVer(WORD scrollCode, int pos, HWND scrollHwnd);
virtual void scrollPosChanged(DwlScrollbar * bar, int pos);
//Additional stuff for StupidSquares:
private:
void blitSelectedSquare(DwlDC & dc);
int verScrollAmtC;
int horScrollAmtC;
StupidSquare * mouseSquareC;
POINT pointInSquareC;
POINT mousePointC;
bool needToBlitCornerC; //Need to blit the lower right hand corner because the
//scrollbars are both visible. (A purist would note that
//it is possible for a user to 'move' a square under this
//'blit', but as this is simply an example, we shall live
//with this 'feature'.)
int scrollbarWidthC;
void constrainSquare(LONG & x, LONG & y);
//For dealing with the mouse:
public:
virtual LRESULT wMouseDown(Button button, WPARAM flags, SHORT x, SHORT y);
virtual LRESULT wMouseMove(WPARAM keys, SHORT x, SHORT y);
virtual LRESULT wMouseUp(Button button, WPARAM flags, SHORT x, SHORT y);
};
#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.