Repository navigation
Expand file tree
/
Copy pathEdit.h
More file actions
97 lines (83 loc) · 2.17 KB
/
Copy pathEdit.h
File metadata and controls
97 lines (83 loc) · 2.17 KB
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
95
96
97
/// \file
/// \author Matthew Allen (fret@memecode.com)
/// \brief An edit box control
#ifndef _GEDIT_H_
#define _GEDIT_H_
#if !WINNATIVE
#include "lgi/common/TextView3.h"
#endif
/// An edit box allowing the user to enter text
class LgiClass LEdit :
#if WINNATIVE
public LControl,
public ResObject
#else
public LTextView3
#endif
{
protected:
class LEditPrivate *d;
#if WINNATIVE
void OnCreate();
LAutoWString SysName();
bool SysName(const char16 *Name);
int SysOnNotify(int Msg, int Code);
bool SysEmptyText();
#endif
public:
/// Constructor
LEdit
(
/// Ctrl's ID
int id,
/// Optional initial text
const char *name = nullptr,
/// Optional initial position
LRect *pos = nullptr
);
~LEdit();
const char *GetClass() { return "LEdit"; }
/// Gets "Allow multiple lines"
bool MultiLine();
/// Sets "Allow multiple lines"
void MultiLine(bool m);
/// Is the text obsured by hashes?
bool Password();
/// Sets the text to be obsured by hashes.
void Password(bool m);
/// Interprets the text in the control as an integer
void Value(int64 i);
/// Sets the text in the control to an integer
int64 Value();
/// Selects a region of text
void Select(int Start = 0, int Len = -1);
/// Get the current selection in characters
LRange GetSelectionRange();
/// Gets the Caret position in characters
ssize_t GetCaret(bool Cursor = true);
/// Sets the Caret position in characters
void SetCaret(size_t Pos, bool Select = false, bool ForceFullUpdate = false);
/// Sets the text to display when the control is empty
void SetEmptyText(const char *EmptyText);
void SelectAll() { Select(); }
bool OnKey(LKey &k);
void KeyProcessed();
LCursor GetCursor(int x, int y) { return LCUR_Ibeam; }
#if WINNATIVE
LMessage::Result OnEvent(LMessage *Msg);
void OnFocus(bool f);
const char *Name() override;
bool Name(const char *s) override;
const char16 *NameW() override;
bool NameW(const char16 *s) override;
#else
bool Paste();
void OnEnter(LKey &k);
bool OnLayout(LViewLayoutInfo &Inf) { return false; }
void OnPaint(LSurface *pDC);
bool SetScrollBars(bool x, bool y);
// Why was this needed?
// void SendNotify(LNotification note);
#endif
};
#endif