Nice work All,
Can anyone tell me how to use the clipper keyboard() command in HMG, This could solve a lot of our problems.
Franco
Textbox and Cursor Position
Moderator: Rathinagiri
Re: Textbox and Cursor Position
All The Best,
Franco
Canada
Franco
Canada
Re: Textbox and Cursor Position
Franco
Functions:
_PushKey and HMG_PressKey (surces in h_hotkey.prg),
Keybd_Event (surce in c_controlmisc.c),
HMG_SendCharacter (surce in c_EventCB.c),
and other.
Read HMG documentation -> Advanced -> Read Keyboard and Mouse.
Functions:
_PushKey and HMG_PressKey (surces in h_hotkey.prg),
Keybd_Event (surce in c_controlmisc.c),
HMG_SendCharacter (surce in c_EventCB.c),
and other.
Read HMG documentation -> Advanced -> Read Keyboard and Mouse.
Re: Textbox and Cursor Position
Thanks KDJ,
I will try all of these
Franco
I will try all of these
Franco
All The Best,
Franco
Canada
Franco
Canada
Re: Textbox and Cursor Position
Hi all,
seems I found the right way and it works perfect. For a beginner it´s a very big chapter to learn "Create Events".
Karl
seems I found the right way and it works perfect. For a beginner it´s a very big chapter to learn "Create Events".
Karl
Code: Select all
//Testprogram Mouseclick in Textbox
#include "hmg.ch"
PROCEDURE main()
DEFINE WINDOW form_1 ;
AT 0,0 ;
WIDTH 600 ;
HEIGHT 230 ;
FONT 'Arial' SIZE 9 ;
TITLE ' Test Program for TextBoxes' ;
MAIN
@ 60,20 LABEL label_1 OF form_1 ;
HEIGHT 20 ;
WIDTH 300 ;
VALUE "Textbox-1 (3 x alpha-Char. and Upper)" ;
FONT 'Arial' SIZE 12
@ 60,370 TEXTBOX text_1 OF form_1 ;
HEIGHT 20 ;
WIDTH 60 ;
VALUE '' ;
FONT 'Arial' SIZE 12;
INPUTMASK 'AAA' ;
ON CHANGE {||THIS.VALUE := HMG_UPPER(THIS.VALUE)} ;
ON GOTFOCUS {||IF(THIS.VALUE = " ", EventStop(EvInd_1, .F.), EventStop(EvInd_1, .T.))}
@ 90,20 LABEL label_2 OF form_1 ;
HEIGHT 20 ;
WIDTH 300 ;
VALUE "Textbox-2 (4 x numeric-Characters)" ;
FONT 'Arial' SIZE 12
@ 90,370 TEXTBOX text_2 OF form_1 ;
HEIGHT 20 ;
WIDTH 60 ;
VALUE '' ;
FONT 'Arial' SIZE 12 ;
INPUTMASK '9999' ;
ON GOTFOCUS {||IF(THIS.VALUE = " ", EventStop(EvInd_2, .F.), EventStop(EvInd_2, .T.))}
@ 120,20 LABEL label_3 OF form_1 ;
HEIGHT 20 ;
WIDTH 350 ;
VALUE "Textbox-3 (17 x alphanumeric Char. and Upper)" ;
FONT 'Arial' SIZE 12
@ 120,370 TEXTBOX text_3 OF form_1 ;
HEIGHT 20 ;
WIDTH 200 ;
VALUE '' ;
FONT 'Arial' SIZE 12 ;
INPUTMASK '!!!!!!!!!!!!!!!!!' ;
ON GOTFOCUS {||IF(THIS.VALUE = " ", EventStop(EvInd_3, .F.), EventStop(EvInd_3, .T.))}
END WINDOW
EvInd_1 := EventCreate("Edit_LBUTTONUP", form_1.text_1.HANDLE, 514)
EvInd_2 := EventCreate("Edit_LBUTTONUP", form_1.text_2.HANDLE, 514)
EvInd_3 := EventCreate("Edit_LBUTTONUP", form_1.text_3.HANDLE, 514)
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
RETURN Nil
FUNCTION Edit_LBUTTONUP()
HMG_EditControlSetSel(EventHWND(), 0, 0)
RETURN NIL
WIN 10 64-bit, WIN 7 32-bit, HMG 3.4.4, 32-bit