-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy pathGUITextPanel.cpp
More file actions
777 lines (590 loc) · 21.8 KB
/
GUITextPanel.cpp
File metadata and controls
777 lines (590 loc) · 21.8 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
//////////////////////////////////////////////////////////////////////////////////////////
// File: GUITextPanel.h
//////////////////////////////////////////////////////////////////////////////////////////
// Description: GUITextPanel class
// Project: GUI Library
// Author(s): Jason Boettcher
// jackal@shplorb.com
// www.shplorb.com/~jackal
//////////////////////////////////////////////////////////////////////////////////////////
// Inclusions of header files
#include "GUI.h"
#include "GUITextPanel.h"
#if defined(__APPLE__)
#include "OsxUtil.h"
#elif defined(__unix__)
// FIXME -- Need to add the Linux version of these "utils"...
#else
#include "WinUtil.h"
#endif // defined(__APPLE__)
using namespace std;
using namespace RTE;
//////////////////////////////////////////////////////////////////////////////////////////
// Constructor: GUITextPanel
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Constructor method used to instantiate a GUITextPanel object in
// system memory.
GUITextPanel::GUITextPanel(GUIManager *Manager)
: GUIPanel(Manager)
{
m_Font = 0;
m_CursorX = m_CursorY = 0;
m_CursorIndex = 0;
m_CursorColor = 0;
m_CursorBlinkCount = 0;
m_FontColor = 0;
m_FontSelectColor = 0;
m_StartIndex = 0;
m_GotSelection = false;
m_SelectedColorIndex = 0;
m_Locked = false;
m_WidthMargin = 3;
m_HeightMargin = 0;
}
// TODO: Both constructors use a common clear function??
// Same with other panels
//////////////////////////////////////////////////////////////////////////////////////////
// Constructor: GUITextPanel
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Constructor method used to instantiate a GUITextPanel object in
// system memory.
GUITextPanel::GUITextPanel()
: GUIPanel()
{
m_Font = 0;
m_Text = "";
m_CursorX = m_CursorY = 0;
m_CursorIndex = 0;
m_CursorColor = 0;
m_CursorBlinkCount = 0;
m_FontColor = 0;
m_FontSelectColor = 0;
m_StartIndex = 0;
m_GotSelection = false;
m_SelectedColorIndex = 0;
m_Locked = false;
m_WidthMargin = 3;
m_HeightMargin = 0;
}
//////////////////////////////////////////////////////////////////////////////////////////
// Method: Create
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Create the panel.
void GUITextPanel::Create(int X, int Y, int Width, int Height)
{
m_X = X;
m_Y = Y;
m_Width = Width;
m_Height = Height;
assert(m_Manager);
}
//////////////////////////////////////////////////////////////////////////////////////////
// Method: ChangeSkin
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Called when the skin has been changed.
void GUITextPanel::ChangeSkin(GUISkin *Skin)
{
// Load the font
string Filename;
Skin->GetValue("TextBox", "Font", &Filename);
m_Font = Skin->GetFont(Filename);
Skin->GetValue("TextBox", "FontColor", &m_FontColor);
Skin->GetValue("TextBox", "FontShadow", &m_FontShadow);
Skin->GetValue("TextBox", "FontKerning", &m_FontKerning);
Skin->GetValue("TextBox", "FontSelectColor", &m_FontSelectColor);
Skin->GetValue("TextBox", "SelectedColorIndex", &m_SelectedColorIndex);
Skin->GetValue("TextBox", "WidthMargin", &m_WidthMargin);
Skin->GetValue("TextBox", "HeightMargin", &m_HeightMargin);
// Convert
m_FontColor = Skin->ConvertColor(m_FontColor);
m_FontSelectColor = Skin->ConvertColor(m_FontSelectColor);
m_SelectedColorIndex = Skin->ConvertColor(m_SelectedColorIndex);
// Pre-cache the font colors
m_Font->CacheColor(m_FontColor);
m_Font->CacheColor(m_FontSelectColor);
// Get the cursor color
Skin->GetValue("TextBox", "CursorColorIndex", &m_CursorColor);
m_CursorColor = Skin->ConvertColor(m_CursorColor);
}
//////////////////////////////////////////////////////////////////////////////////////////
// Method: Draw
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Draws the panel
void GUITextPanel::Draw(GUIScreen *Screen)
{
if (!m_Font)
return;
int FontHeight = m_Font->GetFontHeight();
int wSpacer = m_WidthMargin;
int hSpacer = m_HeightMargin;
// Clamp the cursor
m_CursorX = GUI_MAX(m_CursorX, 0);
// Setup the clipping
Screen->GetBitmap()->SetClipRect(GetRect());
string Text = m_Text.substr(m_StartIndex);
// Draw the text
m_Font->SetColor(m_FontColor);
m_Font->SetKerning(m_FontKerning);
m_Font->Draw(Screen->GetBitmap(), m_X+wSpacer, m_Y+hSpacer, Text, m_FontShadow);
// Draw the right-justified extra text in the background
m_Font->DrawAligned(Screen->GetBitmap(), m_X+m_Width-wSpacer, m_Y+hSpacer, m_RightText, GUIFont::Right, GUIFont::Top, m_Width, m_FontShadow);
// Draw the selected text
if (m_GotSelection && m_GotFocus && !m_Text.empty()) {
// Draw selection mark
Screen->GetBitmap()->DrawRectangle(m_X+wSpacer + m_SelectionX, m_Y + hSpacer + 2, m_SelectionWidth, FontHeight - 3, m_SelectedColorIndex, true);
// Draw text with selection regions in different colour
m_Font->SetColor(m_FontSelectColor);
int Start = GUI_MIN(m_StartSelection, m_EndSelection);
int End = GUI_MAX(m_StartSelection, m_EndSelection);
// Selection
if (m_StartIndex > Start)
Start = m_StartIndex;
m_Font->Draw(Screen->GetBitmap(), m_X+wSpacer+m_SelectionX, m_Y+hSpacer, Text.substr(Start-m_StartIndex, End-Start));
}
// If we have focus, draw the cursor with hacky blink
if (m_GotFocus && (m_CursorBlinkCount++ % 30 > 15))
{
Screen->GetBitmap()->DrawRectangle(m_X + m_CursorX + 2, m_Y + hSpacer + m_CursorY + 2, 1, FontHeight - 3, m_CursorColor, true);
}
// Restore normal clipping
Screen->GetBitmap()->SetClipRect(0);
}
//////////////////////////////////////////////////////////////////////////////////////////
// Method: OnKeyPress
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Called when a key is pressed (OnDown & repeating).
void GUITextPanel::OnKeyPress(int KeyCode, int Modifier)
{
bool Shift = ((Modifier & MODI_SHIFT) != 0); // Condition here to stop the compiler
// bitching about performance
// ModKey is Control key on WIN32 and Apple key on OSX
#if defined(__APPLE__) || defined(__unix__)
bool ModKey = ((Modifier & MODI_COMMAND) != 0);
int asciiChar = KeyCode; // [CHRISK] no conversion needed on APPLE
#elif defined(WIN32)
bool ModKey = ((Modifier & MODI_CTRL) != 0); // Ditto
// To convert to allegro's crazy scheme with their keyboard function returning the order of the letter when ctrl is pressed
int asciiChar = ModKey ? KeyCode + 96 : KeyCode;
#endif // defined(__APPLE__)
if (m_Locked)
return;
// Backspace
if (KeyCode == GUIInput::Key_Backspace) {
if (m_GotSelection) {
RemoveSelectionText();
} else {
if (m_CursorIndex > 0) {
// Decrement the cursor
m_CursorIndex--;
// Delete the character before the cursor
m_Text.erase(m_CursorIndex, 1);
}
}
UpdateText();
SendSignal(Changed, 0);
return;
}
// Delete
if (KeyCode == GUIInput::Key_Delete) {
if (m_GotSelection) {
RemoveSelectionText();
} else {
if (m_CursorIndex < m_Text.size()) {
// Delete the character after the cursor
m_Text.erase(m_CursorIndex,1);
}
}
UpdateText();
SendSignal(Changed, 0);
return;
}
// Left Arrow
if (KeyCode == GUIInput::Key_LeftArrow) {
if (m_CursorIndex > 0) {
// Do Selection
if (Shift)
DoSelection(m_CursorIndex, m_CursorIndex-1);
else
m_GotSelection = false;
// Decrement the cursor
m_CursorIndex--;
UpdateText();
}
return;
}
// Right Arrow
if (KeyCode == GUIInput::Key_RightArrow) {
if (m_CursorIndex < m_Text.size()) {
// Do Selection
if (Shift)
DoSelection(m_CursorIndex, m_CursorIndex+1);
else
m_GotSelection = false;
// Increment the cursor
m_CursorIndex++;
UpdateText();
}
return;
}
// Home
if (KeyCode == GUIInput::Key_Home) {
// Do Selection
if (Shift)
DoSelection(m_CursorIndex, 0);
else
m_GotSelection = false;
m_CursorIndex = 0;
UpdateText();
return;
}
// End
if (KeyCode == GUIInput::Key_End) {
// Do Selection
if (Shift)
DoSelection(m_CursorIndex, m_Text.size());
else
m_GotSelection = false;
m_CursorIndex = m_Text.size();
UpdateText();
return;
}
// ModKey-X (Cut)
if (asciiChar == 'x' && ModKey) {
if (m_GotSelection) {
// Set the clipboard text
#if defined(__APPLE__)
OsxUtil::SetClipboardText(GetSelectionText());
#elif defined(__unix__)
// FIXME -- Need to fix clippoarding code for LINUX
#else
WinUtil::SetClipboardText(GetSelectionText());
#endif // defined(__APPLE__)
RemoveSelectionText();
SendSignal(Changed, 0);
}
return;
}
// ModKey-C (Copy)
if (asciiChar == 'c' && ModKey) {
if (m_GotSelection) {
#if defined(__APPLE__)
OsxUtil::SetClipboardText(GetSelectionText());
#elif defined(__unix__)
// FIXME -- Need to fix clippoarding code for LINUX
#else
// Set the clipboard text
WinUtil::SetClipboardText(GetSelectionText());
#endif // defined(__APPLE__)
}
return;
}
// ModKey-V (Paste)
if (asciiChar == 'v' && ModKey) {
RemoveSelectionText();
string Text = "";
#if defined(__APPLE__)
OsxUtil::GetClipboardText(&Text);
#elif defined(__unix__)
// FIXME -- Need to fix clippoarding code for LINUX
#else
WinUtil::GetClipboardText(&Text);
#endif // defined(__APPLE__)
// Insert the text
m_Text.insert(m_CursorIndex, Text);
m_CursorIndex += Text.size();
UpdateText(true, true);
SendSignal(Changed, 0);
return;
}
// Enter key
if (KeyCode == '\n' || KeyCode =='\r') {
SendSignal(Enter, 0);
return;
}
// Add valid ascii characters
if (KeyCode >= 32 && KeyCode < 128) {
RemoveSelectionText();
char buf[2] = {KeyCode, '\0'};
// Insert the text
m_Text.insert(m_CursorIndex, buf);
m_CursorIndex++;
SendSignal(Changed, 0);
UpdateText(true);
return;
}
}
//////////////////////////////////////////////////////////////////////////////////////////
// Method: OnMouseDown
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Called when the mouse goes down on the panel
void GUITextPanel::OnMouseDown(int X, int Y, int Buttons, int Modifier)
{
SendSignal(MouseDown, Buttons);
if (m_Locked)
return;
// Give me focus
SetFocus();
CaptureMouse();
if (!(Buttons & MOUSE_LEFT))
return;
int OldIndex = m_CursorIndex;
// Set the cursor
string Text = m_Text.substr(m_StartIndex, m_Text.size()-m_StartIndex);
m_CursorIndex = m_Text.size();
if (!(Modifier & MODI_SHIFT))
m_GotSelection = false;
// Go through each character until we to the mouse point
int TX = m_X;
for(int i=0; i<Text.size(); i++) {
TX += m_Font->CalculateWidth(Text.at(i));
if (TX > X) {
m_CursorIndex = i+m_StartIndex;
break;
}
}
// Do a selection if holding the shift button
if (Modifier & MODI_SHIFT)
DoSelection(OldIndex, m_CursorIndex);
// Update the text
UpdateText(false, false);
}
//////////////////////////////////////////////////////////////////////////////////////////
// Method: OnMouseMove
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Called when the mouse moves (over the panel, or when captured).
void GUITextPanel::OnMouseMove(int X, int Y, int Buttons, int Modifier)
{
if (!(Buttons & MOUSE_LEFT) || !IsCaptured())
return;
// Select from the mouse down point to where the mouse is currently
string Text = m_Text.substr(m_StartIndex, m_Text.size() - m_StartIndex);
int TX = m_X;
for(int i=0; i<Text.size(); i++)
{
TX += m_Font->CalculateWidth(Text.at(i));
if (TX >= X)
{
DoSelection(m_CursorIndex, i+m_StartIndex);
m_CursorIndex = i+m_StartIndex;
UpdateText(false, true);
break;
}
}
// Double check for the mouse at the end of the text
if (X > TX)
{
DoSelection(m_CursorIndex, m_Text.size());
m_CursorIndex = m_Text.size();
UpdateText(false, true);
}
}
//////////////////////////////////////////////////////////////////////////////////////////
// Method: OnMouseUp
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Called when the mouse goes up on the panel
void GUITextPanel::OnMouseUp(int X, int Y, int Buttons, int Modifier)
{
ReleaseMouse();
SendSignal(Clicked, Buttons);
}
//////////////////////////////////////////////////////////////////////////////////////////
// Method: UpdateText
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Updates the cursor and start positions.
void GUITextPanel::UpdateText(bool Typing, bool DoIncrement)
{
if (!m_Font)
return;
// Using increments of four characters to show a little extra of the text when
// moving and typing
// Only do this when NOT typing
int Increment = 4;
int Spacer = 2;
if (Typing)
Increment = 1;
// Make sure the cursor is greater or equal to the start index
if (m_CursorIndex <= m_StartIndex && DoIncrement)
m_StartIndex = m_CursorIndex-Increment;
// Clamp it
m_StartIndex = GUI_MAX(m_StartIndex, 0);
// If the cursor is greater than the length of text panel, adjust the start index
string Sub = m_Text.substr(m_StartIndex,m_CursorIndex-m_StartIndex);
while(m_Font->CalculateWidth(Sub) > m_Width-Spacer*2 && DoIncrement) {
m_StartIndex += Increment;
Sub = m_Text.substr(m_StartIndex,m_CursorIndex-m_StartIndex);
}
// Clamp it
m_StartIndex = GUI_MIN(m_StartIndex, m_Text.size()-1);
// Adjust the cursor position
m_CursorX = m_Font->CalculateWidth(m_Text.substr(m_StartIndex, m_CursorIndex-m_StartIndex));
// Update the selection
if (m_GotSelection)
DoSelection(m_StartSelection, m_EndSelection);
}
//////////////////////////////////////////////////////////////////////////////////////////
// Method: DoSelection
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Update the selection.
void GUITextPanel::DoSelection(int Start, int End)
{
// Start a selection
if (!m_GotSelection) {
m_GotSelection = true;
m_StartSelection = Start;
m_EndSelection = End;
} else {
// Update the selection
m_EndSelection = End;
}
// Avoid zero char selections
if (m_GotSelection && m_StartSelection == m_EndSelection)
{
m_GotSelection = false;
return;
}
// Update the selection coords
int StartSel = GUI_MIN(m_StartSelection, m_EndSelection);
int EndSel = GUI_MAX(m_StartSelection, m_EndSelection);
m_SelectionX = StartSel - m_StartIndex;
m_SelectionX = GUI_MAX(m_SelectionX, 0);
int temp = m_SelectionX;
m_SelectionWidth = (EndSel - m_StartIndex) - m_SelectionX;
m_SelectionX = m_Font->CalculateWidth(m_Text.substr(m_StartIndex, m_SelectionX));
m_SelectionWidth = m_Font->CalculateWidth(m_Text.substr(m_StartIndex+temp, m_SelectionWidth));
m_SelectionX = GUI_MAX(m_SelectionX, 0);
m_SelectionWidth = GUI_MIN(m_SelectionWidth, m_Width);
}
//////////////////////////////////////////////////////////////////////////////////////////
// Method: RemoveSelectionTet
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Removes the characters in the selection.
void GUITextPanel::RemoveSelectionText(void)
{
if (!m_GotSelection)
return;
int Start = GUI_MIN(m_StartSelection, m_EndSelection);
int End = GUI_MAX(m_StartSelection, m_EndSelection);
if (Start == End)
return;
m_Text.erase(Start, End-Start);
m_CursorIndex = Start;
UpdateText(false);
m_GotSelection = false;
}
//////////////////////////////////////////////////////////////////////////////////////////
// Method: SetCursorPos
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Sets where the cursor should be. This will clear any selection.
// Arguments: The index of the new cursor position.
void GUITextPanel::SetCursorPos(int cursorPos)
{
m_GotSelection = false;
if (cursorPos <= 0)
cursorPos = 0;
if (cursorPos > m_Text.size())
cursorPos = m_Text.size();
m_CursorIndex = m_Text.size();
UpdateText();
}
//////////////////////////////////////////////////////////////////////////////////////////
// Method: GetSelectionText
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Gets the selection text.
string GUITextPanel::GetSelectionText(void)
{
if (!m_GotSelection)
return "";
int Start = GUI_MIN(m_StartSelection, m_EndSelection);
int End = GUI_MAX(m_StartSelection, m_EndSelection);
if (Start == End)
return "";
return m_Text.substr(Start, End-Start);
}
//////////////////////////////////////////////////////////////////////////////////////////
// Method: SetText
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Sets the text in the textpanel.
void GUITextPanel::SetText(const std::string Text)
{
m_Text = Text;
// Clear the selection
ClearSelection();
// Clear the cursor position
m_CursorIndex = 0;
m_StartIndex = 0;
m_CursorX = 0;
UpdateText(false, false);
SendSignal(Changed, 0);
}
//////////////////////////////////////////////////////////////////////////////////////////
// Method: SetRightText
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Sets the extra text which appears right-justified in the textpanel.
void GUITextPanel::SetRightText(const std::string rightText)
{
m_RightText = rightText;
// UpdateText(false, false);
SendSignal(Changed, 0);
}
//////////////////////////////////////////////////////////////////////////////////////////
// Method: SetSelection
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Sets the start and end indexes of the selection text.
void GUITextPanel::SetSelection(int Start, int End)
{
if (m_Locked)
return;
// Reset the selection
m_GotSelection = false;
DoSelection(Start, End);
UpdateText(false, false);
}
//////////////////////////////////////////////////////////////////////////////////////////
// Method: GetSelectionStart
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Gets the start index of the selection.
int GUITextPanel::GetSelectionStart(void)
{
// No selection?
if (!m_GotSelection)
return -1;
return m_StartSelection;
}
//////////////////////////////////////////////////////////////////////////////////////////
// Method: GetSelectionEnd
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Gets the end index of the selection.
int GUITextPanel::GetSelectionEnd(void)
{
// No selection?
if (!m_GotSelection)
return -1;
return m_EndSelection;
}
//////////////////////////////////////////////////////////////////////////////////////////
// Method: ClearSelection
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Clears the selection. Does NOT remove the selection text though.
void GUITextPanel::ClearSelection(void)
{
m_GotSelection = false;
}
//////////////////////////////////////////////////////////////////////////////////////////
// Method: SetLocked
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Sets the locked state on the textbox.
void GUITextPanel::SetLocked(bool Locked)
{
m_Locked = Locked;
// Clear the selection if we are now locked
if (m_Locked)
ClearSelection();
}
//////////////////////////////////////////////////////////////////////////////////////////
// Method: GetLocked
//////////////////////////////////////////////////////////////////////////////////////////
// Description: Gets the locked state on the textbox.
bool GUITextPanel::GetLocked(void)
{
return m_Locked;
}