97 lines
2.5 KiB
C++
97 lines
2.5 KiB
C++
#ifndef _COMMON_INFOWINDOW_HPP_
|
|
#define _COMMON_INFOWINDOW_HPP_
|
|
#ifndef _COMMON_WINDOW_HPP_
|
|
#include <common/window.hpp>
|
|
#endif
|
|
#ifndef _COMMON_WINDOWS_HPP_
|
|
#include <common/windows.hpp>
|
|
#endif
|
|
#ifndef _COMMON_STRING_HPP_
|
|
#include <common/string.hpp>
|
|
#endif
|
|
#ifndef _COMMON_POINT_HPP_
|
|
#include <common/point.hpp>
|
|
#endif
|
|
|
|
class InfoWindow : public Window
|
|
{
|
|
public:
|
|
enum{WindowWidth=200,WindowHeight=135};
|
|
InfoWindow(Window &parentWindow,WORD windowWidth=WindowWidth,WORD windowHeight=WindowHeight);
|
|
virtual ~InfoWindow();
|
|
void show(int showWindow);
|
|
void setLocation(const Point &topLeftPoint);
|
|
void setCaption(String captionString);
|
|
void setLineText(WORD lineNumber,String lineText);
|
|
void setLineText(Block<String> &lineText,WORD refreshDisplay=TRUE);
|
|
void setLabelText(Block<String> &labelText,WORD refreshDisplay=TRUE);
|
|
WORD widthBorder(void)const;
|
|
WORD heightBorder(void)const;
|
|
WORD windowWidth(void)const;
|
|
WORD windowHeight(void)const;
|
|
HFONT windowFont(void)const;
|
|
private:
|
|
enum {OffsetCaption=20};
|
|
enum {WidthBorderValue=10,HeightBorderValue=15};
|
|
enum {TextHorzBorderOffset=4,TextVertBorderOffset=1};
|
|
static char smszClassName[];
|
|
CallbackData::ReturnType createHandler(CallbackData &someCallbackData);
|
|
CallbackData::ReturnType paintHandler(CallbackData &someCallbackData);
|
|
CallbackData::ReturnType destroyHandler(CallbackData &someCallbackData);
|
|
CallbackData::ReturnType closeHandler(CallbackData &someCallbackData);
|
|
void makeBorderOffsetRect(RECT &borderRect,RECT &clientRect)const;
|
|
void drawText(WORD lineNumber,String lineText);
|
|
void createInfoWindow(void);
|
|
void combineLabelText(void);
|
|
void createInfoFont(void);
|
|
void registerClass(void);
|
|
void removeHandlers(void);
|
|
void paint(PureDevice &windowDevice);
|
|
|
|
Callback<InfoWindow> mCreateHandler;
|
|
Callback<InfoWindow> mPaintHandler;
|
|
Callback<InfoWindow> mDestroyHandler;
|
|
Callback<InfoWindow> mCloseHandler;
|
|
Block<String> mLabelText;
|
|
Block<String> mLineText;
|
|
HINSTANCE mhInstance;
|
|
HFONT mhInfoFont;
|
|
Window &mParentWindow;
|
|
WORD mIsDestroyed;
|
|
WORD mCharHeight;
|
|
WORD mWindowWidth;
|
|
WORD mWindowHeight;
|
|
Point mTopLeftPoint;
|
|
};
|
|
|
|
inline
|
|
WORD InfoWindow::widthBorder(void)const
|
|
{
|
|
return WidthBorderValue;
|
|
}
|
|
|
|
inline
|
|
WORD InfoWindow::heightBorder(void)const
|
|
{
|
|
return HeightBorderValue;
|
|
}
|
|
|
|
inline
|
|
WORD InfoWindow::windowWidth(void)const
|
|
{
|
|
return mWindowWidth;
|
|
}
|
|
|
|
inline
|
|
WORD InfoWindow::windowHeight(void)const
|
|
{
|
|
return mWindowHeight;
|
|
}
|
|
|
|
inline
|
|
HFONT InfoWindow::windowFont(void)const
|
|
{
|
|
return mhInfoFont;
|
|
}
|
|
#endif
|