James,
yes, they can be used from resources too. Anyhow the more users that try it the better to improve it ![]()
James,
yes, they can be used from resources too. Anyhow the more users that try it the better to improve it ![]()
Antonio,
Is there an example available in the samples of the TEdit class used from resources?
I can't find one.
If not, can you provide one here?
Thanks a lot in advance.
Regards,
Michel D.
Genk (Belgium)
I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773
#include "FiveWin.ch"
function Main()
local oDlg, cTest := "Hello world"
DEFINE DIALOG oDlg RESOURCE "Test"
REDEFINE EDIT cTest ID 110 OF oDlg
REDEFINE BUTTON ID 120 OF oDlg ACTION MsgInfo( cTest )
ACTIVATE DIALOG oDlg CENTERED
return nil#ifdef __FLAT__
1 24 "winxp\WindowsXP.Manifest"
#endif
#ifdef __64__
1 24 "winxp\WindowsXP.Manifest64"
#endif
Test DIALOG 0, 0, 300, 150
STYLE DS_MODALFRAME | WS_BORDER | WS_DLGFRAME | WS_POPUP | WS_SYSMENU
FONT 8, "MS Sans Serif"
CAPTION "Dialog"
BEGIN
EDITTEXT 110, 11, 11, 80, 13, ES_AUTOHSCROLL
PUSHBUTTON "&Value", 120, 112, 112, 60, 17
END#xcommand REDEFINE EDIT [ <oEdit> VAR ] <uVar> ;
[ ID <nId> ] ;
[ <dlg: OF, WINDOW, DIALOG> <oWnd> ] ;
=> ;
[ <oEdit> := ] TEdit():Redefine( <nId>, [<oWnd>],;
bSETGET(<uVar>) )METHOD ReDefine( nId, oWnd, bSetGet ) CLASS TEdit
DEFAULT oWnd := GetWndDefault()
::nId = nId
::oWnd = oWnd
::bSetGet = bSetGet
oWnd:DefControl( Self )
return SelfAntonio,
Tedit class from resources is working fine the way you suggested it.
I noticed one problem (for me).
If the Tedit field has the focus, and you press the end-key on your keyboard, then the cursor goes to the end of the datafield, spaces included.
Shouldn't it be more logic that the cursor goes just behind the last character if the end-key is pressed?
Will the changes you suggested be included in FWH 13.09?
Thanks.
Regards,
Michel D.
Genk (Belgium)
I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773
Michel,
If we do that, then it will not be Windows standard. So we are again in a similar situation, allowing non standard Windows behaviors.
But we can do it, if you need it ![]()
Yes, its already included for FWH 13.09
Antonio Linares wrote:If we do that, then it will not be Windows standard.
Enrico,
If you run the testedi2.prg that I published here, and change the variable this way:
local oDlg, cTest := "Hello world "
then if you press end, it goes to the end of the string (including spaces) and we do nothing with the keyboard there. In fact, I have declared both methods as virtual:
METHOD KeyDown() VIRTUAL
METHOD KeyChar() VIRTUAL
So it seems as this is the default behavior. I have also removed ES_AUTOHSCROLL from the RC and the same behavior.
More over, if you test it from PellesC resources editor, you will see that if you add some spaces to the end of the text, the caret goes to the end of the spaces. So the only way not to have that behavior is that the variable have NO spaces at the end.
Maybe I am missing something... ![]()
Antonio Linares wrote:Maybe I am missing something...
Antonio,
One more question about Tedit class : how do we define the picture?
Thanks.
Regards,
Michel D.
Genk (Belgium)
I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773
One interesting point RE spaces.
With (x)Harbour we limit the length of the input by padding any data with spaces so we often have spaces at the end of the text.
I tried a standard Microsoft Windows app (Outlook Express) and by default the fields have no length (and no spaces) and allow you to enter data up to a set length. I don' know how that length is determined. When you enter a field and then press the End button, the cursor doesn't move. Perhaps there is a property to set the field length?
James
James Bott wrote:One interesting point RE spaces.
With (x)Harbour we limit the length of the input by padding any data with spaces so we often have spaces at the end of the text.
I tried a standard Microsoft Windows app (Outlook Express) and by default the fields have no length (and no spaces) and allow you to enter data up to a set length. I don' know how that length is determined. When you enter a field and then press the End button, the cursor doesn't move. Perhaps there is a property to set the field length?
James