TGet Class

Post Reply
Horizon
Posts: 997
Joined: Fri May 23, 2008 1:33 pm

TGet Class

Post by Horizon »

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 & VS 2019 & FWH 20.12
Horizon
Posts: 997
Joined: Fri May 23, 2008 1:33 pm

Post by Horizon »

Any idea?
Regards,

Hakan ONEMLI

Harbour & VS 2019 & FWH 20.12
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

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

Code: Select all

#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
Horizon
Posts: 997
Joined: Fri May 23, 2008 1:33 pm

Post by Horizon »

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).

Code: Select all

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 & VS 2019 & FWH 20.12
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

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:

Image

Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
Horizon
Posts: 997
Joined: Fri May 23, 2008 1:33 pm

Post by Horizon »

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 & VS 2019 & FWH 20.12
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

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
Horizon
Posts: 997
Joined: Fri May 23, 2008 1:33 pm

Post by Horizon »

Thanks Antonio.

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

Hakan ONEMLI

Harbour & VS 2019 & FWH 20.12
Post Reply