FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TGet Class
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
TGet Class
Posted: Tue Sep 09, 2008 02:20 PM

Hi,

Is there any problem in TGet Class in 8.03. I think the cursor is not right place, when you fill the field at last character. it always is len(x)-1. In this condition user want to delete all character, one character is left.

Secondly, When you double click the previously filled get, normally only non empty all character should be select. but 8.03, selects also empty space character?

Anyone knows why?

Thanks,

Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
TGet Class
Posted: Wed Sep 10, 2008 07:05 AM

Any idea?

Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
TGet Class
Posted: Wed Sep 10, 2008 07:48 AM
Hakan,

FiveWin GETs use a Harbour GET object to mimic its behavior on the Windows GET. When you go to the end of a GET in Clipper, the cursor does not go past the last character. The same happens in the Windows GET (in fact we just copy the cursor position from the Harbour GET to the Windows GET).

If you run this example and double click on a word, you will see that it behaves the same as other Windows applications. If you are using a resource dialog, execute it from the resource editor, type on it and double click on the words:

test.prg
#include "FiveWin.ch" 

function Main() 

   local oDlg, cText := "Hello world!   " 

   DEFINE DIALOG oDlg TITLE "Test" 

   @ 2, 2 GET cText OF oDlg

   ACTIVATE DIALOG oDlg CENTERED 

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
TGet Class
Posted: Wed Sep 10, 2008 08:59 AM
Hi Antonio,

You mean it is windows behaviour (get position). But I have not seen any get like i mentioned in any windows application.

I have created to new project in BRW and add Edit Text Style in a dialog. When I test it, get position is past of the last character.

I also examine the UEStudio. There is not any get like i mentioned. (in Configuration)

double click event is also our get class problem i think. In order to use GET system, we should the set initial value to determine the get size (as a character).
cText := "Hello world!   "

So, end of our most variables has the space characters. When you double click the "Hello" word, its ok. It select the "Hello ". But the "world!" word is selected, it select the "world! " (There are 3 space). Because we have the space characters end of variable. But I think I should be only "world!" without space characters.

> (in fact we just copy the cursor position from the Harbour GET to the Windows GET).

When did you do this change. It might be its my version porblem.

Thanks again.
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
TGet Class
Posted: Wed Sep 10, 2008 09:36 AM
Hakan,

> You mean it is windows behaviour (get position).

No, I said it is Harbour behavior (same as Clipper). In Clipper the cursor does not go after the last character.

> But I have not seen any get like i mentioned in any windows application.

We use Harbour PICTURE clauses, so we need to use a Harbour GET.

This is an example with UEStudio. I have typed "Hello world! " and I double clicked on world! The same selection as us:



regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
TGet Class
Posted: Wed Sep 10, 2008 10:58 AM

Hi Antonio

>> You mean it is windows behaviour (get position).

>No, I said it is Harbour behavior (same as Clipper). In Clipper the >cursor does not go after the last character.

Ok. I understand. Which one is true? We try to write an applications in Windows. Should we use Windows rules?. Is it a Harbour restriction or choice?

>This is an example with UEStudio. I have typed "Hello world! " and I >double clicked on world! The same selection as us:

You are right. if you enter three space after "world!". But practically, we don't enter spaces after last word.

Thanks,

Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
TGet Class
Posted: Wed Sep 10, 2008 04:58 PM

Hakan,

> Should we use Windows rules?

We want PICTUREs (with masks too), VALIDs, WHENs... they are not Windows "standard" features, but we find the way to implement them.

To get the above we use a Harbout GET object, and the Harbour GET object behaves that way.

You could modify Harbour Class TGet and change its behavior. But I warn you it is a messy code in Harbour.

> Is it a Harbour restriction or choice?

It is Clipper behavior, that was mimic in Harbour. But we are using an open source compiler, so you can modify its source code. Please review Harbour\source\rtl\tget.prg

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
TGet Class
Posted: Thu Sep 11, 2008 08:07 AM

Thanks Antonio.

I will review Harbour\source\rtl\tget.prg

Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06

Continue the discussion