summaryrefslogtreecommitdiff
path: root/widgettextfield.h
blob: c1208f0677604ad10c2fe8448295d12724cf7d70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#ifndef WIDGETTEXTFIELD_H
#define WIDGETTEXTFIELD_H

#include <skygi/skygi.h>

#include "widget.h"

//! A Textfield class

class CTextfield: public CWidget {
	public:
		/*! Constructor */
		CTextfield();
		
		/*!
			Create Textfield
			
			\param parent HANDLE of the parent window on which to draw
			\param name Name of the Textfield
			\param x Top left x coordinate
			\param y Top left y coordinate
			\param w Form width
			\param h Form height
			\param style Style flags
			
			\return Success: S_OK\n
			Failure: E_HANDLE
			
			\see GetParent()
		*/
		HRESULT	Create(HANDLE parent, char * name, int x, int y, int w, int h, int style);
		
		/*!
			Adds text without a trailing newline
			
			\param line Text to add
			
			\see AddLine()
		*/
		HRESULT	Add(char * line);
		
		/*!
			Loads a file
			
			\param filename Name of file to load
		*/
		HRESULT AddFile(char * filename);
		
		/*!
			Adds text with a trailing newline
			
			\param line Text to add
			
			\see Add()
		*/
		HRESULT AddLine(char * line);
		
		/*!
			Clears all text
		*/
		HRESULT DeleteText();
		
		/*!
			Redraw Textfield
		*/
		HRESULT Redraw();
		
		/*!
			Turn on or off password mode
			
			\param passwordmode Password Mode
		*/
		HRESULT PasswordMode(bool passwordmode);
		
		/*!
			Turn on or off read only mode
			
			\param readonly Read only mode
		*/
		HRESULT ReadonlyMode(bool readonly);
		
		/*!
			Turn on or off single kine mode
			
			\param singleline Single Line mode
		*/
		HRESULT SingleLine(bool singleline);
		
		HRESULT Undo();
		HRESULT UndoAvailable();
		HRESULT UndoReset();
};

#endif