March 28, 2024, 04:04:47 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Unicode tooltips

Started by Andy, August 31, 2018, 06:07:02 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andy

Hopefully my final Unicode question for some time.

I have some tooltips in my program, but they are in English (ANSI).

I know to display a Unicode tooltip I must use the CreateWindowExW function, but as always I'm having trouble translating the MSDN examples to IWB.

Here is a link to what I've found:

https://docs.microsoft.com/en-us/windows/desktop/controls/tooltip-controls

I am unsure about the whole process of creating a tooltip, setting it's position, and adding tools to it.

Could anyone provide a simple window, with one button, and a tooltip that displays Unicode characters?

Thanks,
Andy.
:)
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

fasecero

This is the example that I have generated from that page but for some reason it does not work. It should work according to the documentation


$INCLUDE "windowssdk.inc"
$INCLUDE "Commctrl.inc"

HWND hwndTip = 0
INT subclassID = 12345

CONST BUTTON_1 = 1
CONST BUTTON_2 = 2
WINDOW w1
OPENWINDOW w1,0,0,400,400,@MINBOX|@MAXBOX|@SIZE,NULL,"Simple Window",&w1_handler
CONTROL w1,@SYSBUTTON,"Button #1",100,124,181,48,0x50000000,BUTTON_1
CONTROL w1,@SYSBUTTON,"Button #2",100,194,181,48,0x50000000,BUTTON_2

' main loop
WAITUNTIL w1 = 0
END

' window procedure
SUB w1_handler
SELECT @MESSAGE
CASE @IDCREATE
CENTERWINDOW w1
OnInit()

CASE @IDCLOSEWINDOW
OnFinish()
CLOSEWINDOW w1
ENDSELECT
ENDSUB

SUB subclassProc(hWnd:INT,uMsg:INT,wParam:INT,lParam:INT,uIdSubclass:UINT_PTR,dwRefData:DWORD_PTR),INT
SELECT uMsg
CASE WM_NOTIFY
SELECT *<NMHDR>lparam.hwndFrom
CASE hwndTip
SELECT *<NMHDR>lparam.code
CASE TTN_GETDISPINFO ' set the tooltip text for each ctrl
SELECT wParam
CASE GetDlgItem(hWnd, BUTTON_1)
*<NMTTDISPINFOW>lparam.lpszText = L"Button #1 tooltip"
CASE GetDlgItem(hWnd, BUTTON_2)
*<NMTTDISPINFOW>lparam.lpszText = L"Button #2 tooltip"
ENDSELECT
ENDSELECT
ENDSELECT

DEFAULT
RETURN DefSubclassProc(hWnd, uMsg, wParam, lParam)
ENDSELECT

RETURN 0
ENDSUB

SUB OnInit()
' subclass the window
SetWindowSubclass(w1.hwnd, &subclassProc, subclassID, 0)

' init common controls
_InitCommonControls()

' create the tooltip
hwndTip = TooltipCreate(w1.hwnd)

' asign the tooltip to each control
TooltipAddControl(hwndTip, w1.hwnd, BUTTON_1)
TooltipAddControl(hwndTip, w1.hwnd, BUTTON_2)
ENDSUB

SUB OnFinish()
RemoveWindowSubclass(w1.hwnd, &subclassProc, subclassID)
ENDSUB

' ------------------------------------------------------------------------------------------------------------
' UNICODE FUNCTIONS
' ------------------------------------------------------------------------------------------------------------

SUB _InitCommonControls()
' Ensures that the common control DLL (Comctl32.dll) is loaded, and registers specific common control classes from the DLL.
' An application must call this function before creating a common control.
INITCOMMONCONTROLSEX icc
icc.dwSize=LEN(icc)
icc.dwICC= ICC_BAR_CLASSES | ICC_LINK_CLASS | ICC_LISTVIEW_CLASSES | ICC_PROGRESS_CLASS | ICC_TAB_CLASSES | ICC_TREEVIEW_CLASSES | ICC_UPDOWN_CLASS
InitCommonControlsEx (&icc)
ENDSUB

' -------

SUB TooltipCreate(int parent), INT
INT handle = CreateWindowExW(NULL, TOOLTIPS_CLASSW, NULL, _
WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP, _
CW_USEDEFAULT, CW_USEDEFAULT, _
CW_USEDEFAULT, CW_USEDEFAULT, _
parent, NULL, GetModuleHandle(0), _
NULL)

SetWindowPos(handle, HWND_TOPMOST,0, 0, 0, 0, _
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE)

RETURN handle
ENDSUB

SUB TooltipAddControl(INT tooltip_handle, INT parent, uint ctrlID), INT
TOOLINFOW ti

ti.cbSize= LEN(ti)
    ti.uFlags=TTF_TRANSPARENT|TTF_SUBCLASS
    ti.hInst=GetModuleHandle(0)
    ti.lpszText=LPSTR_TEXTCALLBACKW

ti.uFlags=ti.uFlags|TTF_IDISHWND
ti.hWnd=parent
ti.uId=GetDlgItem(parent, ctrlID)

RETURN _SendMessage(tooltip_handle, TTM_ADDTOOLW, 0, &ti)
ENDSUB


fasecero

There were several mistakes but it seems that only one was my fault.

- Some code inside OnInit() should be relocated below the the button creation
- TTN_GETDISPINFOW notification can't be handled by the subclass procedure because the tooltip's parent (WINDOW w1) is not unicode
- (The most crazy one) TOOLINFOW needs a size of 40 instead of LEN(TOOLINFOW) if a manifest file is not used...

Here is a functional example


$INCLUDE "windowssdk.inc"
$INCLUDE "Commctrl.inc"

HWND hwndTip = 0
INT subclassID = 12345

CONST BUTTON_1 = 1
CONST BUTTON_2 = 2
WINDOW w1
OPENWINDOW w1,0,0,400,400,@MINBOX|@MAXBOX|@SIZE,NULL,"Simple Window",&w1_handler
CONTROL w1,@SYSBUTTON,"Button #1",100,124,181,48,0x50000000,BUTTON_1
CONTROL w1,@SYSBUTTON,"Button #2",100,194,181,48,0x50000000,BUTTON_2
AfterUIInitialized()

' main loop
WAITUNTIL w1 = 0
END

' window procedure
SUB w1_handler
SELECT @MESSAGE
CASE @IDCREATE
CENTERWINDOW w1
OnInit()

CASE @IDCLOSEWINDOW
CLOSEWINDOW w1
ENDSELECT
ENDSUB

SUB OnInit()
' init common controls
_InitCommonControls()

' create the tooltip
hwndTip = TooltipCreate(w1.hwnd)
ENDSUB

SUB AfterUIInitialized()
' asign the tooltip to each control
ControlAsignTooltipText(hwndTip, w1.hwnd, BUTTON_1, L"Button #1 tooltip")
ControlAsignTooltipText(hwndTip, w1.hwnd, BUTTON_2, L"Button #2 tooltip")
ENDSUB

' ------------------------------------------------------------------------------------------------------------
' UNICODE FUNCTIONS
' ------------------------------------------------------------------------------------------------------------

SUB _InitCommonControls()
' Ensures that the common control DLL (Comctl32.dll) is loaded, and registers specific common control classes from the DLL.
' An application must call this function before creating a common control.
INITCOMMONCONTROLSEX icc
icc.dwSize=LEN(icc)
icc.dwICC= ICC_BAR_CLASSES | ICC_LINK_CLASS | ICC_LISTVIEW_CLASSES | ICC_PROGRESS_CLASS | ICC_TAB_CLASSES | ICC_TREEVIEW_CLASSES | ICC_UPDOWN_CLASS
InitCommonControlsEx (&icc)
ENDSUB

' -------

SUB TooltipCreate(int parent), INT ' TTS_BALLOON optional
INT handle = CreateWindowExW(NULL, TOOLTIPS_CLASSW, NULL, _
WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP | TTS_BALLOON, _
CW_USEDEFAULT, CW_USEDEFAULT, _
CW_USEDEFAULT, CW_USEDEFAULT, _
parent, NULL, GetModuleHandle(0), _
NULL)

SetWindowPos(handle, HWND_TOPMOST,0, 0, 0, 0, _
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE)

RETURN handle
ENDSUB

SUB ControlAsignTooltipText(INT tooltip_handle, INT parent, uint ctrlID, WSTRING tooltipText), INT
TOOLINFOW ti

ti.cbSize= 40 ' LEN(ti) ° 40 without manifest file, LEN(ti) with manifest file...
    ti.uFlags=TTF_TRANSPARENT|TTF_SUBCLASS
    ti.hInst=GetModuleHandle(0)
    ti.lpszText=tooltipText

ti.uFlags=ti.uFlags|TTF_IDISHWND
ti.hWnd=parent
ti.uId=GetDlgItem(parent, ctrlID)

RETURN _SendMessage(tooltip_handle, TTM_ADDTOOLW, 0, &ti)
ENDSUB


Andy

Fasecero,

That is superb!

I was close with the tool tip creation, but no where near with the rest of what you have coded.

I've added in a sample tool tip message.

Brian suggested using SENDMESSAGE to give the tool tip a heading / change colour etc (in the TooltipCreate section).


$INCLUDE "windowssdk.inc"
$INCLUDE "Commctrl.inc"

HWND hwndTip = 0
INT subclassID = 12345

CONST BUTTON_1 = 1
CONST BUTTON_2 = 2
WINDOW w1

wstring conf
wstring conf2
wstring conf3

OPENWINDOW w1,0,0,400,400,@MINBOX|@MAXBOX|@SIZE,NULL,"Simple Window",&w1_handler
CONTROL w1,@SYSBUTTON,"Button #1",100,124,181,48,0x50000000,BUTTON_1
CONTROL w1,@SYSBUTTON,"Button #2",100,194,181,48,0x50000000,BUTTON_2
AfterUIInitialized()

' main loop
WAITUNTIL w1 = 0
END

' window procedure
SUB w1_handler
SELECT @MESSAGE
CASE @IDCREATE
CENTERWINDOW w1
OnInit()

CASE @IDCLOSEWINDOW
CLOSEWINDOW w1
ENDSELECT
ENDSUB

SUB OnInit()
' init common controls
_InitCommonControls()

' create the tooltip
hwndTip = TooltipCreate(w1.hwnd)
ENDSUB

SUB AfterUIInitialized()
' asign the tooltip to each control

conf = L""
conf = conf + DeleteCText(200,"S1")

conf2 = L""
conf2 = conf2 + DeleteCText(200,"S2")

conf3 = L""
conf3 = conf3 + DeleteCText(200,"S3")

ControlAsignTooltipText(hwndTip, w1.hwnd, BUTTON_1, conf+L" "+conf2+L" "+conf3)
ControlAsignTooltipText(hwndTip, w1.hwnd, BUTTON_2, StaticText(200,"Close"))
ENDSUB

' ------------------------------------------------------------------------------------------------------------
' UNICODE FUNCTIONS
' ------------------------------------------------------------------------------------------------------------

SUB _InitCommonControls()
' Ensures that the common control DLL (Comctl32.dll) is loaded, and registers specific common control classes from the DLL.
' An application must call this function before creating a common control.
INITCOMMONCONTROLSEX icc
icc.dwSize=LEN(icc)
icc.dwICC= ICC_BAR_CLASSES | ICC_LINK_CLASS | ICC_LISTVIEW_CLASSES | ICC_PROGRESS_CLASS | ICC_TAB_CLASSES | ICC_TREEVIEW_CLASSES | ICC_UPDOWN_CLASS
InitCommonControlsEx (&icc)
ENDSUB

' -------

SUB TooltipCreate(int parent), INT ' TTS_BALLOON optional
INT handle = CreateWindowExW(NULL, TOOLTIPS_CLASSW, NULL, _
WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP | TTS_BALLOON, _
CW_USEDEFAULT, CW_USEDEFAULT, _
CW_USEDEFAULT, CW_USEDEFAULT, _
parent, NULL, GetModuleHandle(0), _
NULL)

'SENDMESSAGE handle,TTM_SETTIPBKCOLOR,0x956A,0
SENDMESSAGE handle,TTM_SETTITLE,0,"Unicode Tooltip"

SetWindowPos(handle, HWND_TOPMOST,0, 0, 0, 0, _
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE)

RETURN handle
ENDSUB

SUB ControlAsignTooltipText(INT tooltip_handle, INT parent, uint ctrlID, WSTRING tooltipText), INT
TOOLINFOW ti

ti.cbSize= 40 ' LEN(ti) ° 40 without manifest file, LEN(ti) with manifest file...
    ti.uFlags=TTF_TRANSPARENT|TTF_SUBCLASS
    ti.hInst=GetModuleHandle(0)
    ti.lpszText=tooltipText

ti.uFlags=ti.uFlags|TTF_IDISHWND
ti.hWnd=parent
ti.uId=GetDlgItem(parent, ctrlID)

RETURN _SendMessage(tooltip_handle, TTM_ADDTOOLW, 0, &ti)
ENDSUB

SUB StaticText(INT textLen,STRING TextName),WSTRING
WSTRING text=L""
POINTER p=&text+0
INT j,a

RESTORE UpdateText
   restore DeleteText
   restore CancelText
   restore CloseText
   restore OpenText
restore CompactText
   restore AddText
RESTORE EditText
   restore KeyboardText
   restore EntertextText

FOR j=1 TO textLen
if TextName = "Save" then GETDATA UpdateText,a
if TextName = "Delete" then GETDATA DeleteText,a
if TextName = "Cancel" then GETDATA CancelText,a
if TextName = "Close" then GETDATA CloseText,a
if TextName = "Open" then GETDATA OpenText,a
if TextName = "Compact" then GETDATA CompactText,a
if TextName = "Add" then GETDATA AddText,a
if TextName = "Edit" then GETDATA EditText,a
if TextName = "Keyboard" then GETDATA KeyboardText,a
if TextName = "Enter text" then GETDATA EntertextText,a
*<CHAR>p=a
p+=1
NEXT j
   DELETE p
RETURN text
ENDSUB

databegin UpdateText
data 65,0,192,3,191,3,184,3,174,3,186,3,181,3,197,3,195,3,183,3,0,0
dataend

databegin DeleteText
data 148,3,185,3,177,3,179,3,193,3,172,3,198,3,201,3,0,0
dataend

databegin CancelText
data 145,3,186,3,205,3,193,3,201,3,195,3,183,3,0,0
dataend

databegin CloseText
data  149,3,190,3,191,3,180,3,191,3,194,3,0,0
dataend

databegin OpenText
data 145,3,189,3,191,3,185,3,190,3,181,3,0,0
dataend

databegin CompactText
data 163,3,197,3,188,3,192,3,177,3,179,3,174,3,194,3,0,0
dataend

databegin AddText
data 160,3,193,3,191,3,195,3,184,3,173,3,196,3,201,3,0,0
dataend

databegin EditText
data 145,3,187,3,187,3,177,3,179,3,174,3,0,0
dataend

databegin KeyboardText
data 160,3,187,3,183,3,186,3,196,3,193,3,191,3,187,3,204,3,179,3,185,3,191,3,0,0
dataend

databegin EntertextText
data 149,3,185,3,195,3,177,3,179,3,172,3,179,3,181,3,196,3,181,3,32,0,186,3,181,3,175,3,188,3,181,3,189,3,191,3,0,0
dataend

SUB DeleteCText(INT textLen,string TextName),WSTRING
wstring text=L""
pointer p=&text+0
INT j,a,al
   restore st1Text
   restore st2Text
   restore st3Text
   restore st4Text
   restore st5Text
   restore DeletingText
FOR j=1 TO textLen
      al=a
if TextName="S1" then GETDATA st1Text,a
if TextName="S2" then GETDATA st2Text,a
if TextName="S3" then GETDATA st3Text,a
if TextName="S4" then GETDATA st4Text,a
if TextName="S5" then GETDATA st5Text,a
if TextName="Deleting" then GETDATA DeletingText,a
*<char>p=a
p+=1
   if a = 0 and al = 0 then breakfor
   NEXT j
   delete p
RETURN text
ENDSUB

DATABEGIN st1Text
data 151,3,32,0,181,3,179,3,179,3,193,3,177,3,198,3,174,3,32,0,196,3,191,3,197,3,32,0,192,3,181,3,187,3,172,3,196,3,183,3,32,0,186,3,177,3,185,3,32,0,191,3,187,3,181,3,194,3,32,0,191,3,185,3,0,0
dataend

databegin st2Text
data 195,3,199,3,181,3,196,3,185,3,186,3,173,3,194,3,32,0,181,3,179,3,179,3,193,3,177,3,198,3,173,3,194,3,32,0,195,3,197,3,189,3,196,3,177,3,179,3,206,3,189,3,0,0
dataend

databegin st3Text
data 184,3,177,3,32,0,180,3,185,3,177,3,179,3,193,3,177,3,198,3,191,3,205,3,189,3,0,0
dataend

databegin st4Text
data 160,3,177,3,196,3,174,3,195,3,196,3,181,3,32,0,79,0,75,0,32,0,179,3,185,3,177,3,32,0,189,3,177,3,32,0,180,3,185,3,177,3,179,3,193,3,172,3,200,3,181,3,196,3,181,3,0,0
dataend

databegin st5Text
data 174,3,32,0,145,3,186,3,205,3,193,3,201,3,195,3,183,3,32,0,196,3,183,3,194,3,32,0,180,3,185,3,177,3,179,3,193,3,177,3,198,3,174,3,194,3,0,0
dataend

databegin DeletingText
data 148,3,185,3,177,3,179,3,193,3,177,3,198,3,174,3,0,0
dataend


Thanks,
Andy.
:)
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

fasecero

Remember to use SendMessageW instead of SENDMESSAGE since you are dealing with unicode and SENDMESSAGE only supports ANSI messages. While somethimes this works a lot of times will not. I tend to forget this too :), I was calling _SendMessage (same as SENDMESSAGE) instead of SendmessageW in my ControlAsignTooltipText procedure. I have added a little more customization in the tooltip creation function


$INCLUDE "windowssdk.inc"
$INCLUDE "Commctrl.inc"

HWND hwndTip = 0
INT subclassID = 12345

CONST BUTTON_1 = 1
CONST BUTTON_2 = 2
WINDOW w1

wstring conf
wstring conf2
wstring conf3

OPENWINDOW w1,0,0,400,400,@MINBOX|@MAXBOX|@SIZE,NULL,"Simple Window",&w1_handler
CONTROL w1,@SYSBUTTON,"Button #1",100,124,181,48,0x50000000,BUTTON_1
CONTROL w1,@SYSBUTTON,"Button #2",100,194,181,48,0x50000000,BUTTON_2
AfterUIInitialized()

' main loop
WAITUNTIL w1 = 0
END

' window procedure
SUB w1_handler
SELECT @MESSAGE
CASE @IDCREATE
CENTERWINDOW w1
OnInit()

CASE @IDCLOSEWINDOW
CLOSEWINDOW w1
ENDSELECT
ENDSUB

SUB OnInit()
' init common controls
_InitCommonControls()

' create the tooltip
hwndTip = TooltipCreate(w1.hwnd)
ENDSUB

SUB AfterUIInitialized()
' asign the tooltip to each control

conf = L""
conf = conf + DeleteCText(200,"S1")

conf2 = L""
conf2 = conf2 + DeleteCText(200,"S2")

conf3 = L""
conf3 = conf3 + DeleteCText(200,"S3")

ControlAsignTooltipText(hwndTip, w1.hwnd, BUTTON_1, conf+L" "+conf2+L" "+conf3)
ControlAsignTooltipText(hwndTip, w1.hwnd, BUTTON_2, StaticText(200,"Close"))
ENDSUB

' ------------------------------------------------------------------------------------------------------------
' UNICODE FUNCTIONS
' ------------------------------------------------------------------------------------------------------------

SUB _InitCommonControls()
' Ensures that the common control DLL (Comctl32.dll) is loaded, and registers specific common control classes from the DLL.
' An application must call this function before creating a common control.
INITCOMMONCONTROLSEX icc
icc.dwSize=LEN(icc)
icc.dwICC= ICC_BAR_CLASSES | ICC_LINK_CLASS | ICC_LISTVIEW_CLASSES | ICC_PROGRESS_CLASS | ICC_TAB_CLASSES | ICC_TREEVIEW_CLASSES | ICC_UPDOWN_CLASS
InitCommonControlsEx (&icc)
ENDSUB

' -------

SUB TooltipCreate(int parent), INT ' TTS_BALLOON optional
INT handle = CreateWindowExW(NULL, TOOLTIPS_CLASSW, NULL, _
WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP | TTS_BALLOON, _
CW_USEDEFAULT, CW_USEDEFAULT, _
CW_USEDEFAULT, CW_USEDEFAULT, _
parent, NULL, GetModuleHandle(0), _
NULL)

'SENDMESSAGE handle,TTM_SETTIPBKCOLOR,0x956A,0
'SENDMESSAGE handle,TTM_SETTITLE,0,"Unicode Tooltip"

wstring title = L"Unicode Tooltip"
SendMessageW(handle, TTM_SETTITLEW, TTI_INFO, &title)

SendMessageW(handle, TTM_SETTIPBKCOLOR , RGB(213,225,243), 0)
SendMessageW(handle, TTM_SETTIPTEXTCOLOR  , RGB(75,80,84), 0)

SendMessageW(handle, TTM_SETMAXTIPWIDTH , 0, 150) ' maximun pixel widht

WINRECT rc
rc.left = 7 : rc.top = 7 : rc.right = 7 : rc.bottom = 7
SendMessageW(handle, TTM_SETMARGIN, 0, &rc) ' margin

SetWindowPos(handle, HWND_TOPMOST,0, 0, 0, 0, _
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE)

RETURN handle
ENDSUB

SUB ControlAsignTooltipText(INT tooltip_handle, INT parent, uint ctrlID, WSTRING tooltipText), INT
TOOLINFOW ti

ti.cbSize= 40 ' LEN(ti) ° 40 without manifest file, LEN(ti) with manifest file...
    ti.uFlags=TTF_TRANSPARENT|TTF_SUBCLASS
    ti.hInst=GetModuleHandle(0)
    ti.lpszText=tooltipText

ti.uFlags=ti.uFlags|TTF_IDISHWND
ti.hWnd=parent
ti.uId=GetDlgItem(parent, ctrlID)

RETURN SendMessageW(tooltip_handle, TTM_ADDTOOLW, 0, &ti)
ENDSUB

SUB StaticText(INT textLen,STRING TextName),WSTRING
WSTRING text=L""
POINTER p=&text+0
INT j,a

RESTORE UpdateText
   restore DeleteText
   restore CancelText
   restore CloseText
   restore OpenText
restore CompactText
   restore AddText
RESTORE EditText
   restore KeyboardText
   restore EntertextText

FOR j=1 TO textLen
if TextName = "Save" then GETDATA UpdateText,a
if TextName = "Delete" then GETDATA DeleteText,a
if TextName = "Cancel" then GETDATA CancelText,a
if TextName = "Close" then GETDATA CloseText,a
if TextName = "Open" then GETDATA OpenText,a
if TextName = "Compact" then GETDATA CompactText,a
if TextName = "Add" then GETDATA AddText,a
if TextName = "Edit" then GETDATA EditText,a
if TextName = "Keyboard" then GETDATA KeyboardText,a
if TextName = "Enter text" then GETDATA EntertextText,a
*<CHAR>p=a
p+=1
NEXT j
   DELETE p
RETURN text
ENDSUB

databegin UpdateText
data 65,0,192,3,191,3,184,3,174,3,186,3,181,3,197,3,195,3,183,3,0,0
dataend

databegin DeleteText
data 148,3,185,3,177,3,179,3,193,3,172,3,198,3,201,3,0,0
dataend

databegin CancelText
data 145,3,186,3,205,3,193,3,201,3,195,3,183,3,0,0
dataend

databegin CloseText
data  149,3,190,3,191,3,180,3,191,3,194,3,0,0
dataend

databegin OpenText
data 145,3,189,3,191,3,185,3,190,3,181,3,0,0
dataend

databegin CompactText
data 163,3,197,3,188,3,192,3,177,3,179,3,174,3,194,3,0,0
dataend

databegin AddText
data 160,3,193,3,191,3,195,3,184,3,173,3,196,3,201,3,0,0
dataend

databegin EditText
data 145,3,187,3,187,3,177,3,179,3,174,3,0,0
dataend

databegin KeyboardText
data 160,3,187,3,183,3,186,3,196,3,193,3,191,3,187,3,204,3,179,3,185,3,191,3,0,0
dataend

databegin EntertextText
data 149,3,185,3,195,3,177,3,179,3,172,3,179,3,181,3,196,3,181,3,32,0,186,3,181,3,175,3,188,3,181,3,189,3,191,3,0,0
dataend

SUB DeleteCText(INT textLen,string TextName),WSTRING
wstring text=L""
pointer p=&text+0
INT j,a,al
   restore st1Text
   restore st2Text
   restore st3Text
   restore st4Text
   restore st5Text
   restore DeletingText
FOR j=1 TO textLen
      al=a
if TextName="S1" then GETDATA st1Text,a
if TextName="S2" then GETDATA st2Text,a
if TextName="S3" then GETDATA st3Text,a
if TextName="S4" then GETDATA st4Text,a
if TextName="S5" then GETDATA st5Text,a
if TextName="Deleting" then GETDATA DeletingText,a
*<char>p=a
p+=1
   if a = 0 and al = 0 then breakfor
   NEXT j
   delete p
RETURN text
ENDSUB

DATABEGIN st1Text
data 151,3,32,0,181,3,179,3,179,3,193,3,177,3,198,3,174,3,32,0,196,3,191,3,197,3,32,0,192,3,181,3,187,3,172,3,196,3,183,3,32,0,186,3,177,3,185,3,32,0,191,3,187,3,181,3,194,3,32,0,191,3,185,3,0,0
dataend

databegin st2Text
data 195,3,199,3,181,3,196,3,185,3,186,3,173,3,194,3,32,0,181,3,179,3,179,3,193,3,177,3,198,3,173,3,194,3,32,0,195,3,197,3,189,3,196,3,177,3,179,3,206,3,189,3,0,0
dataend

databegin st3Text
data 184,3,177,3,32,0,180,3,185,3,177,3,179,3,193,3,177,3,198,3,191,3,205,3,189,3,0,0
dataend

databegin st4Text
data 160,3,177,3,196,3,174,3,195,3,196,3,181,3,32,0,79,0,75,0,32,0,179,3,185,3,177,3,32,0,189,3,177,3,32,0,180,3,185,3,177,3,179,3,193,3,172,3,200,3,181,3,196,3,181,3,0,0
dataend

databegin st5Text
data 174,3,32,0,145,3,186,3,205,3,193,3,201,3,195,3,183,3,32,0,196,3,183,3,194,3,32,0,180,3,185,3,177,3,179,3,193,3,177,3,198,3,174,3,194,3,0,0
dataend

databegin DeletingText
data 148,3,185,3,177,3,179,3,193,3,177,3,198,3,174,3,0,0
dataend