mirror of
https://github.com/quantum5/Zalgo.git
synced 2025-04-24 13:41:57 -04:00
Also: 1. Cleaned up text handling by storing them in resource. 2. Added useful methods to make code look better. 3. Allowed PreviewWindow to be used for general text displaying.
40 lines
956 B
C++
40 lines
956 B
C++
#pragma once
|
|
#ifndef id68C60174_0140_4DE1_B7255EFF557A74F9
|
|
#define id68C60174_0140_4DE1_B7255EFF557A74F9
|
|
|
|
#include <Window.hpp>
|
|
#include <MyDropTarget.hpp>
|
|
|
|
#include <commctrl.h>
|
|
#include <shellapi.h>
|
|
|
|
#define WM_CHANGETEXT (WM_USER+1)
|
|
|
|
class PreviewWindow : public Window {
|
|
public:
|
|
virtual LPCTSTR ClassName() { return L"Zalgo_Preview"; }
|
|
static PreviewWindow *Create(LPCTSTR szTitle);
|
|
void Destroy() { DestroyWindow(m_hwnd); }
|
|
|
|
void ChangeText(LPWSTR text, bool padding = true);
|
|
void SetFont(HFONT hFont);
|
|
void SetFont(const LOGFONT &lf);
|
|
protected:
|
|
LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
|
|
LRESULT OnCreate();
|
|
LRESULT OnDestroy();
|
|
void OnPaint();
|
|
|
|
virtual HICON GetIcon();
|
|
private:
|
|
HFONT hFont;
|
|
bool used_logfont;
|
|
HBRUSH hBrush;
|
|
int xChar, yChar, xUpper, xClient, yClient, xClientMax, xPos, yPos;
|
|
LPTSTR *lpLines;
|
|
int lines;
|
|
bool empty;
|
|
};
|
|
|
|
#endif // header
|