TGet Class

TGet Class

Postby Horizon » Tue Sep 09, 2008 2: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.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Postby Horizon » Wed Sep 10, 2008 7:05 am

Any idea?
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Postby Antonio Linares » Wed Sep 10, 2008 7: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
Code: Select all  Expand view
#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
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Horizon » Wed Sep 10, 2008 8: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).
Code: Select all  Expand view
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.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Postby Antonio Linares » Wed Sep 10, 2008 9: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:

Image

Image
regards, saludos

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

Postby Horizon » 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.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Postby Antonio Linares » Wed Sep 10, 2008 4: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Horizon » Thu Sep 11, 2008 8:07 am

Thanks Antonio.

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

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 71 guests

cron