Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2000-01

SetCursor

7 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Shane Miller

While working on ShowCaret I decided to do SetCursor because I stumbled upon the code. :-)

I started it. It's not perfect yet (what is?) and there is an issue. It seems like each pgtkwidget has a pgdkwindow. If it doesn't have a pgdkwindow then widget^.window points to it's Parent's pgdkWindow. So, when I set the cursor (say for mwedit) it actaully set's it's parent's cursor. If it's parent is a form and the form has buttons on it, it seems to change the cursor for the buttons too.

For example, run lazarus, press the TESTFORM button and press the SETTEXT button on the test form. The text "Lazarus test code" appear in the mwedit. Then I change the cursor to the IBeam and now the entire form uses that cursor........see the problem? I haven't looked into it yet too much. Just wanted to get something working with the cursors.

Shane

Reply by email

Marc Weustink
to Shane Miller: If I set the cursor for the FIXED widget, then all controls on that widget are effected. …

+ From: Shane Miller
+
+ If I set the cursor for the FIXED widget, then all controls
+ on that widget are effected. If I simply try to change the
+ cursor for the widget, it should only affect that widget.

I understand, however some of our controls consists of a fixed widget within an other widget. I did mean the contained fixed (not the fixed widget on which the control is located)..... or did you mean the same ?

Marc

Reply by email

Shane Miller

I see. I thought you were referring to the fixed widget that is on the FORM. When you call gdk_window_set_cursor you send it the PGTKWIDGET's ^.window property which is it's GDKWINDOW or (if it doesn't have one) it's parent's GDKWINDOW. I will look into seeing if the control has a fixed widget, but I think that will cause the same issues. For example, if you have a widget that has a fixed widget on it and you set it's cursor, what happens if you add controls to the widget?

I'll look into this a bit more. Did you look at it by pressing the SETTEXT button on the testform?

Shane

>> 01/12/00 10:02AM >>>

+ From: Shane Miller
+
+ If I set the cursor for the FIXED widget, then all controls
+ on that widget are effected. If I simply try to change the
+ cursor for the widget, it should only affect that widget.

I understand, however some of our controls consists of a fixed widget within an other widget. I did mean the contained fixed (not the fixed widget on which the control is located)..... or did you mean the same ?

Marc

_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Marc Weustink
to Shane Miller

+ From: Shane Miller
+
+ I see. I thought you were referring to the fixed widget that
+ is on the FORM.

No.

+ When you call gdk_window_set_cursor you send it the
+ PGTKWIDGET's ^.window property which is it's GDKWINDOW or (if
+ it doesn't have one) it's parent's GDKWINDOW. I will look
+ into seeing if the control has a fixed widget, but I think
+ that will cause the same issues.

In the beginning I thought it might make a difference, now, I'm not sure.

+ For example, if you have a
+ widget that has a fixed widget on it and you set it's cursor,
+ what happens if you add controls to the widget?

You add the controls to the fixed widget. I exepect that will get the same cursor as theit parent (=fixed).

+ I'll look into this a bit more. Did you look at it by
+ pressing the SETTEXT button on the testform?

Nope, I'm at work now, I only read the list.

Marc

Reply by email

Shane Miller

If I set the cursor for the FIXED widget, then all controls on that widget are effected. If I simply try to change the cursor for the widget, it should only affect that widget.

Shane
Get paid to surf the net!
http://www.alladvantage.com/go.asp?refid=DEX-870 and please use my membership ID (DEX-870) when asked if you were referred by someone.

>> 01/11/00 04:04PM >>>
Shane wrote 10 lines
While working on ShowCaret I decided to do SetCursor because I stumbled upon the code. :-) I started it. It's not perfect yet (what is?) and there is an issue. It seems like each pgtkwidget has a pgdkwindow. If it doesn't have a pgdkwindow then widget^.window points to it's Parent's pgdkWindow. So, when I set the cursor (say for mwedit) it actaully set's it's parent's cursor. If it's parent is a form and the form has buttons on it, it seems to change the cursor for the buttons too.

Hmm... don't focus to much on mwEdit. The underlying control is under heavy construstion and it's behaviour may change with the day. BTW, did you set the cursor on the "mainwidget".window or on the fixed.window. The latter seems for me the widget to use (if present).

Marc

_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Marc Weustink
to Shane Miller: While working on ShowCaret I decided to do SetCursor because I stumbled upon the code. …
Shane wrote 10 lines
While working on ShowCaret I decided to do SetCursor because I stumbled upon the code. :-) I started it. It's not perfect yet (what is?) and there is an issue. It seems like each pgtkwidget has a pgdkwindow. If it doesn't have a pgdkwindow then widget^.window points to it's Parent's pgdkWindow. So, when I set the cursor (say for mwedit) it actaully set's it's parent's cursor. If it's parent is a form and the form has buttons on it, it seems to change the cursor for the buttons too.

Hmm... don't focus to much on mwEdit. The underlying control is under heavy construstion and it's behaviour may change with the day. BTW, did you set the cursor on the "mainwidget".window or on the fixed.window. The latter seems for me the widget to use (if present).

Marc

Reply by email

Shane Miller

I have moved the initial creation of the cursors to GTKObject.Init and the destruction to AppTerminate. This was you aren't creating a cursor each time you change to another type.

Does anyone know of a method to grab the current cursor? I would like to determine what the default cursor is for a control so when a user set's the Cursor property to crDefault I would know what to set it to...

Shane

>> 01/12/00 10:47AM >>>

+ From: Shane Miller
+
+ I see. I thought you were referring to the fixed widget that
+ is on the FORM.

No.

+ When you call gdk_window_set_cursor you send it the
+ PGTKWIDGET's ^.window property which is it's GDKWINDOW or (if
+ it doesn't have one) it's parent's GDKWINDOW. I will look
+ into seeing if the control has a fixed widget, but I think
+ that will cause the same issues.

In the beginning I thought it might make a difference, now, I'm not sure.

+ For example, if you have a
+ widget that has a fixed widget on it and you set it's cursor,
+ what happens if you add controls to the widget?

You add the controls to the fixed widget. I exepect that will get the same cursor as theit parent (=fixed).

+ I'll look into this a bit more. Did you look at it by
+ pressing the SETTEXT button on the testform?

Nope, I'm at work now, I only read the list.

Marc

_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus

Reply by email