Problem with TGET class in FWH 13.08

Re: Problem with TGET class in FWH 13.08

Postby Antonio Linares » Mon Sep 30, 2013 5:33 pm

James,

yes, they can be used from resources too. Anyhow the more users that try it the better to improve it :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42094
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Problem with TGET class in FWH 13.08

Postby driessen » Mon Sep 30, 2013 6:38 pm

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. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Problem with TGET class in FWH 13.08

Postby Antonio Linares » Mon Sep 30, 2013 8:00 pm

Michel,

testedi2.prg
Code: Select all  Expand view
#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


testedi2.rc
Code: Select all  Expand view
#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


Also in FiveWin.ch this command is needed: (We did not include it in FWH yet)
Code: Select all  Expand view
#xcommand REDEFINE EDIT [ <oEdit> VAR ] <uVar> ;
            [ ID <nId> ] ;
            [ <dlg: OF, WINDOW, DIALOG> <oWnd> ] ;
       => ;
          [ <oEdit> := ] TEdit():Redefine( <nId>, [<oWnd>],;
                                           bSETGET(<uVar>) )


And finally in edit.prg a change is required:
Code: Select all  Expand view
METHOD ReDefine( nId, oWnd, bSetGet ) CLASS TEdit

   DEFAULT oWnd := GetWndDefault()

   ::nId     = nId
   ::oWnd    = oWnd
   ::bSetGet = bSetGet

   oWnd:DefControl( Self )

return Self


Thanks for testing it and for your feedback :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42094
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Problem with TGET class in FWH 13.08

Postby driessen » Mon Sep 30, 2013 10:27 pm

Antonio,

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. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Problem with TGET class in FWH 13.08

Postby Antonio Linares » Tue Oct 01, 2013 5:16 am

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
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42094
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Problem with TGET class in FWH 13.08

Postby Enrico Maria Giordano » Tue Oct 01, 2013 8:04 am

Antonio,

Antonio Linares wrote:If we do that, then it will not be Windows standard.


As far as I know, it is Windows standard behavior to put the caret after the last non-space character. Am I wrong?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Problem with TGET class in FWH 13.08

Postby Antonio Linares » Tue Oct 01, 2013 8:17 am

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... :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42094
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Problem with TGET class in FWH 13.08

Postby Enrico Maria Giordano » Tue Oct 01, 2013 8:22 am

Antonio,

Antonio Linares wrote:Maybe I am missing something... :-)


No, you are right and I was wrong. :-)

The unusual behavior is exactly the spaces after the text...

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Problem with TGET class in FWH 13.08

Postby driessen » Tue Oct 01, 2013 9:46 am

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. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Problem with TGET class in FWH 13.08

Postby Antonio Linares » Tue Oct 01, 2013 10:55 am

Michel,

The fact is a that a standard Windows Edit control does not support pictures :-(

http://msdn.microsoft.com/en-us/library/windows/desktop/bb775458(v=vs.85).aspx

thats the whole point for using a related Harbour GET, to get pictures and masks.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42094
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Problem with TGET class in FWH 13.08

Postby James Bott » Tue Oct 01, 2013 4:33 pm

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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Problem with TGET class in FWH 13.08

Postby Enrico Maria Giordano » Tue Oct 01, 2013 5:01 pm

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


Yes, the EM_LIMITTEXT message. :-)

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 93 guests