Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
10
Erster Beitrag:
vor 9 Jahren, 11 Monaten
Letzter Beitrag:
vor 4 Jahren, 11 Monaten
Beteiligte Autoren:
Sohan, Al, Jose Antonio Garrido, Danny Lauwers, GuenterP, ocakici

XY coordinates of edit control input area

Startbeitrag von Sohan am 07.08.2008 14:02

Hi all,

Does anyone know a way to retrieve the X and Y coordinates of the input area of an edit control or combo box? The ..X and ..Y properties refer to the position of the label, not the input area.

I noticed that the Handle function can return "the handle of the edit control associated with a combo box", but where do I go from there? I assume that I could call some kind of system function (API?) which takes this handle and returns the coordinates. How would I do this?

Regarding the edit control: Windev does not seem to make the distinction between the editable control and its label. Is there a back door for this? How can I retrieve the X and Y coordinates of the input area of an edit control?

TIA,
/sohan

Antworten:

Hello Sohan

What are you trying to do when you find out the x,y co-ordinates ?

Maybe the ..Cursor property or the CursorPos command offer some possibilities

Regards
Al

von Al - am 07.08.2008 21:23
Hi Al,

I implemented self-written balloon tips for field validations. I like validation messages such as "This field is mandatory", "Birth date cannot be in the future" etc. to be non blocking, so I do not want to use dialog boxes. When the balloon tip appears, its "arrow" should point to the input area, where the invalid value has been entered, not to its label.

Regards,
/sohan


von Sohan - am 08.08.2008 21:19
Hi, if you're using WinDev 12 then there is a new thing called 'information text' - this is a gray help-text in the input area, just like the password-input for Windows Vista right when it's started. Kind regards, Guenter

von GuenterP - am 08.08.2008 22:22
Sohan

In Webdev, X,Y attributes return the input area's coordiantes in browser code, and the label's coordiantes in Server code. I don't see any built-in function to control either separately.

would it be a lot of work to remove the captions from edit controls, and add static control captions?

Oguz

von ocakici - am 08.08.2008 22:34
Hello Oguz,

Separating the captions from their controls is not an option. Not only would it be a lot of work for existing apps, it would also complicate future development. And in fact, the job of translating an app is eased by the fact that a control (usually containing some sort of help info) is connected to its label. For example, by looking at the tooltip the translator can distinguish between label `Client` (in the context of Client/Server) and label `Client`(in the context of Vendor/Customer). So the link between the control and its label is usefull in more than one way.

Thx anyway,
/sohan

von Sohan - am 08.08.2008 23:47
Hello Sohan

There are a number of things you can find out about the control that may help you to position the arrow better

length(fieldname..caption).
fieldname..fontsize

You might be able to calculate the x,y position of the arrow by experimenting with diferent adjustments based on the fontsize and the length of the caption.

Regards
Al




von Al - am 09.08.2008 00:16
Hi Al,

Thought of that too, but is does not work. Problem is that the lenght of the caption and the position of the input area are not related. Edit controls are most often aligned vertically, labels seperately from the input areas:


__________
short label |__________|

__________
much longer label |__________|


If I take the lenght of the label as a starting point for some sort of calculation, it would only give me the position directly next to it, which is not necessarily the position of the input area.

Thanks for the suggestion though.

/sohan

von Sohan - am 09.08.2008 13:09
Hi,

Did anybody found a solution for this problem, I am facing the same problem when I want to position my touch numeric keypad near the input area.

I am using WinDev 18

Thanks
Danny

von Danny Lauwers - am 07.08.2013 07:40
You should put the numeric keypad just below or above the edit control, so it's not the same problem.( You dont have to worry about the length of the edit control)


Sample:
numerickeypad..y = edit_control..y + edit_control..height + 10

I'm not sure if you should sum the height, ignore it, or substract it. Anyway it depends where you want to place the numeric keypad.

von Jose Antonio Garrido - am 07.08.2013 09:10
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.