Update of /cvsroot/win32forth/win32forth/src/console
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10305
Modified Files:
CommandWindow.f
Log Message:
Rod: new CommandFont for each instance of CommandWindow - this class can now be reused without interferring with the console
Index: CommandWindow.f
===================================================================
RCS file: /cvsroot/win32forth/win32forth/src/console/CommandWindow.f,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** CommandWindow.f 25 Aug 2008 18:11:45 -0000 1.16
--- CommandWindow.f 26 Aug 2008 17:20:50 -0000 1.17
***************
*** 1,25 ****
\ $Id$
! (( [cdo] moved in primutil.f
! : PauseForMessages { | pMsg -- } \ Winpause
! 7 cells LocalAlloc: pMsg
! BEGIN PM_REMOVE 0 0 0 pMsg Call PeekMessage
! WHILE pMsg HandleMessages drop
! REPEAT
! ;
! ))
!
!
! 0 value cn
! Font CommandFont
! 10 Height: CommandFont
! \ FW_HEAVY Weight: CommandFont \ Optional
! s" Courier" SetFaceName: CommandFont
! \ s" Terminal" SetFaceName: CommandFont \ Optional choise
!
! defer HandleKeys
! defer HandleKeyDown
! defer LogKeyStrokes
--- 1,17 ----
\ $Id$
+ \ CommandWindow - a child window class to accept and edit text on a command line by Rod Oakford
+ \
+ \ Features:
+ \
+ \ Action when enter is pressed is deferred
+ \ Font changeable
+ \ Key buffer
+ \ Command history
+ \ Cut, copy and paste
! defer HandleKeys ' drop is HandleKeys \ define to handle keys e.g. 'O' +k_control
! defer HandleKeyDown ' drop is HandleKeyDown \ define to handle virtual keys e.g. VK_F12
! defer LogKeyStrokes ' noop is LogKeyStrokes \ used in KeySave.f defined as menukey-more
***************
*** 33,41 ****
:M SetAction: ( xt -- ) to action ;M
! int font
int hFont
:M SetFont: ( font -- )
! delete: font to font create: font
! Handle: font to hFont paint: self
PauseForMessages BigCursor: [ self ]
;M
--- 25,33 ----
:M SetAction: ( xt -- ) to action ;M
! int CommandFont
int hFont
:M SetFont: ( font -- )
! delete: CommandFont to CommandFont create: CommandFont
! Handle: CommandFont to hFont paint: self
PauseForMessages BigCursor: [ self ]
;M
***************
*** 814,818 ****
true to editing
;M
!
:M DeleteSelectedText: ( -- ) \ adjust X if necessary
SelectedLength
--- 806,811 ----
true to editing
;M
! int cn
! ((
:M DeleteSelectedText: ( -- ) \ adjust X if necessary
SelectedLength
***************
*** 836,839 ****
--- 829,833 ----
THEN
;M
+ ))
int cnn
:M DeleteSelectedText: ( -- ) \ adjust X if necessary
***************
*** 1210,1216 ****
8 to HorzLine
13 to VertLine
- CommandFont to font
- Create: CommandFont
- Handle: CommandFont to hFont
Black to ForegroundColour
White to BackgroundColour
--- 1204,1207 ----
***************
*** 1236,1239 ****
--- 1227,1237 ----
:M On_Init: ( -- )
+ new> font to CommandFont
+ 10 Height: CommandFont
+ \ FW_HEAVY Weight: CommandFont \ Optional
+ s" Courier" SetFaceName: CommandFont
+ \ s" Terminal" SetFaceName: CommandFont \ Optional choice
+ Create: CommandFont
+ Handle: CommandFont to hFont
MaxText malloc to text text MaxText 45 fill 0 text c! \ text MaxText erase
CommandFont SetFont: self \ this creates a caret in BigCursor: self
***************
*** 1244,1248 ****
;Class
-
- ' drop is HandleKeys
- ' drop is HandleKeyDown
--- 1242,1243 ----
|