Sign in Join

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

Mailing lists / lazarus / 2000-06

ControlDragging was: Re: CVS Changes

44 messages · 8 people ·

Reply by email Subscribe to this list Your subscription

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

Shane Miller

I think I have it working correctly if I get the right coord's for the parent. The problem with using X and Y are that you don't ever know if they are X and Y relative to the control (if you move only one pixel up, the mouse is still within the control) or if the X and Y are relative to the parent.

If you select a middle of the button and you get your x and y of 12,5, you can move off the mouse (with the button down) and you'll start seeing other X and Y coord's that are associated with the form.

I think we need to fix this issue and then it will work.

P.S. There are no unnecessary emails as long as you are trying to help. Keep sending ideas.

Shane

>> 06/15/00 03:17PM >>>

sorry, find another solution:

Procedure TDesignerForm.MouseMove(Sender: TObject; Shift: TShiftState;
X, Y: Integer);
var
  dx, dy: Integer;
begin
  //if TCOntrol(sender).dragging then
  if (FMoveCOntrol.Control = Sender)
  then begin
    dx := X - FMoveCOntrol.X;
    dy := Y - FMoveCOntrol.Y;
    FMoveControl.Control.Left := dX;
    FMoveControl.Control.Top  := dY;
  end;
end;

...sorry for the two unnecessary emails....

br
alex

Alexander Reiter wrote 71 lines
i think the problem is in TDesignerForm.MouseMove. if you try this, you can move your control. well is not the best solution, but it is a good starting point. take a look at this: Procedure TDesignerForm.MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); var dx, dy: Integer; begin //if TCOntrol(sender).dragging then if (FMoveCOntrol.Control = Sender) then begin WriteLn(Format('[TDesignerForm.MouseMove] Start(%d, %d) Stop(%d, %d)', [FMoveCOntrol.X, FMoveCOntrol.Y, X, Y])); not correct --> //dx := X - FMoveCOntrol.X; not correct --> //dy := Y - FMoveCOntrol.Y; dx := X - FMoveControl.Control.Left; dy := Y - FMoveControl.Control.Top; FMoveControl.Control.Left := FMoveControl.Control.Left + dX; FMoveControl.Control.Top := FMoveControl.Control.Top + dY; end; end; br alex Marc Weustink wrote: > > At 13:30 14-06-2000 -0500, Shane Miller wrote: > > >Press the NEW FORM button. > >Select the Button component and drop it onto the form. > >Drag the button 2 pixels up. It probably moved a little. Now do it again. > >It doesn't work. > >If you look at the output ( in mousedown and mouseup > >to see what SHOULD be displayed) you'll see that the TOP and LEFT seem to > >be reported incorrectly. > >If you MOVE the form then try it again it's reported correctly. > >This also occurs when trying to place controls onto the form. Sometimes > >they appear correctly, sometimes not. > >When they dont you can move the form and thn the next one appears > >correctly. > > > >Any ideas? > > Mouse.Cursorpos is given in screen coordinates, not in form coordinates. > Onmousedown you store Cursorpos (or better, the given X and Y), > onmouseUp you calc the difference with the new Cursorpos (or better, the > given X and Y) THe difference is added to the Left and Top. > > I committed a solution which normally should work, however it doesn't due > to a bug in the MouseMove and MouseUp handlers > > MouseMove / MouseUp should always give the mouseposition X and Y in the > Sender coordinates. It does as long as the up event occoured in the > control itself. However if you are outside the control you get the X and Y > in Form coordinates. > > Marc > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

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

Reply by email

Shane Miller
to Shane Miller: I added the following: Click on a VCL speedbutton on the first tnotebook age and it stays…

If you are wondering how long it will be until "LAZARUS" will be usable to create applications then I couldn't give you a real good idea. I'm hoping for more help on it and if I get it I could see it becoming usable in a few months.

However, the component library is usable. You can create applications from it at this point using the gtk library through the LCL.

The data aware components are already there in some cases. I should yeild this answer to someone else but I am aware of some of the components already. I know the interbase components exist...

I'm not sure what the ELF resource thing is....

Shane

Earlier message 21 lines
----- Original Message ----- From: Chris Bordeman To: Sent: Monday, June 12, 2000 3:48 PM Subject: Re: [lazarus] CVS Changes > I was wondering, I have been following the list for a long time, do you guys > have a vague idea on how long until Lazarus is usable with a complete set of > components (including data aware ones), and the ELF resource thing is > implemented and used by Lazarus? > > Chris Bordeman > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus >

Reply by email

Marc Weustink
to Marc Weustink: + + >I was initialy just drawing it but now I'm thinking I should + actually create a…
Alexander Reiter wrote 23 lines
i think the problem is in TDesignerForm.MouseMove. if you try this, you can move your control. well is not the best solution, but it is a good starting point. take a look at this: Procedure TDesignerForm.MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); var dx, dy: Integer; begin //if TCOntrol(sender).dragging then if (FMoveCOntrol.Control = Sender) then begin WriteLn(Format('[TDesignerForm.MouseMove] Start(%d, %d) Stop(%d, %d)', [FMoveCOntrol.X, FMoveCOntrol.Y, X, Y])); not correct --> //dx := X - FMoveCOntrol.X; not correct --> //dy := Y - FMoveCOntrol.Y; dx := X - FMoveControl.Control.Left; dy := Y - FMoveControl.Control.Top; FMoveControl.Control.Left := FMoveControl.Control.Left + dX; FMoveControl.Control.Top := FMoveControl.Control.Top + dY; end; end;

Don't think so.
X and Y are the coordinates of the mousepointer within the control at the moment of the mousedown/move event, so you must calc the relave displacement from these points and not from the left and top. Otherwise you are comapring two different things.

Marc

Reply by email

Marc Weustink
to Marc Weustink: + + >I was initialy just drawing it but now I'm thinking I should + actually create a…
Shane Miller wrote 14 lines
Press the NEW FORM button. Select the Button component and drop it onto the form. Drag the button 2 pixels up. It probably moved a little. Now do it again. It doesn't work. If you look at the output ( in mousedown and mouseup to see what SHOULD be displayed) you'll see that the TOP and LEFT seem to be reported incorrectly. If you MOVE the form then try it again it's reported correctly. This also occurs when trying to place controls onto the form. Sometimes they appear correctly, sometimes not. When they dont you can move the form and thn the next one appears correctly. Any ideas?

Mouse.Cursorpos is given in screen coordinates, not in form coordinates. Onmousedown you store Cursorpos (or better, the given X and Y), onmouseUp you calc the difference with the new Cursorpos (or better, the given X and Y) THe difference is added to the Left and Top.

I committed a solution which normally should work, however it doesn't due to a bug in the MouseMove and MouseUp handlers

MouseMove / MouseUp should always give the mouseposition X and Y in the Sender coordinates. It does as long as the up event occoured in the control itself. However if you are outside the control you get the X and Y in Form coordinates.

Marc

Reply by email

Alexander Reiter
to Marc Weustink: + + >I was initialy just drawing it but now I'm thinking I should + actually create a…

i think the problem is in TDesignerForm.MouseMove. if you try this, you can move your control. well is not the best solution, but it is a good starting point. take a look at this:

 Procedure TDesignerForm.MouseMove(Sender: TObject; Shift: TShiftState;
X, Y: Integer);
var
  dx, dy: Integer;
begin
  //if TCOntrol(sender).dragging then
  if (FMoveCOntrol.Control = Sender)
  then begin
    WriteLn(Format('[TDesignerForm.MouseMove] Start(%d, %d) Stop(%d,
%d)', [FMoveCOntrol.X, FMoveCOntrol.Y, X, Y]));
  not correct  --> //dx := X - FMoveCOntrol.X;
  not correct  --> //dy := Y - FMoveCOntrol.Y;
     dx := X - FMoveControl.Control.Left;
     dy := Y - FMoveControl.Control.Top;
    FMoveControl.Control.Left := FMoveControl.Control.Left + dX;
    FMoveControl.Control.Top  := FMoveControl.Control.Top + dY;
  end;
end;

br
alex

Marc Weustink wrote 37 lines
At 13:30 14-06-2000 -0500, Shane Miller wrote: >Press the NEW FORM button. >Select the Button component and drop it onto the form. >Drag the button 2 pixels up. It probably moved a little. Now do it again. >It doesn't work. >If you look at the output ( in mousedown and mouseup >to see what SHOULD be displayed) you'll see that the TOP and LEFT seem to >be reported incorrectly. >If you MOVE the form then try it again it's reported correctly. >This also occurs when trying to place controls onto the form. Sometimes >they appear correctly, sometimes not. >When they dont you can move the form and thn the next one appears >correctly. > >Any ideas? Mouse.Cursorpos is given in screen coordinates, not in form coordinates. Onmousedown you store Cursorpos (or better, the given X and Y), onmouseUp you calc the difference with the new Cursorpos (or better, the given X and Y) THe difference is added to the Left and Top. I committed a solution which normally should work, however it doesn't due to a bug in the MouseMove and MouseUp handlers MouseMove / MouseUp should always give the mouseposition X and Y in the Sender coordinates. It does as long as the up event occoured in the control itself. However if you are outside the control you get the X and Y in Form coordinates. Marc _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Shane Miller

I now made labels appear. They didn't contain anything so they didn't appear.

The components appear in the wrong spot sometimes. It's odd. Select a control, move the form then drop the control and it works.

Select a control and click on the form to place it and it appears in the wrong spot. The GETNAME function in TDesignerform tries to get a unique name for that form.

Shane

Reply by email

Shane Miller
to Marc Weustink: + + >I was initialy just drawing it but now I'm thinking I should + actually create a…

I would like to see that code.
Shane

Earlier message 41 lines
----- Original Message ----- From: Marc Weustink To: 'Lazarus' Sent: Wednesday, June 14, 2000 11:23 AM Subject: RE: [lazarus] CVS Changes > + On 06/14/2000 at 10:03 AM Shane Miller wrote: > + > + >I was initialy just drawing it but now I'm thinking I should > + actually create a control (6 of them) each time something new > + gets focus. > + > + Do you need 6 controls? Or one control that ignores events > + not in one of the 6 areas? > > ??? 6 ??? IMO you need 8 > > + Or would grabbers be part of a control only accesable at > + design time, and thus defined at the TWinControl level, and > + thus written once and once only? > > Or are they part of the designer form. I myself don't feel for an > implementation in TWincontrol. It's a design feature not a runtime. > > They are drawn by the form at this moment so the form can check which one is > grabbed. > > BTW, Delphi 4 creates 8 TGrabHandle windows as child of the design form > > Hmm.... thinking of this, I've somewhere a piece of code which defines and > implements grabhandles. I can use/commit/publis this if we want ? > > Marc > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus >

Reply by email

Robert Scott Horning
to Shane Miller: I added the following: Click on a VCL speedbutton on the first tnotebook age and it stays…
Shane Miller wrote 9 lines
I added the following: Click on a VCL speedbutton on the first tnotebook age and it stays selected. Mouse pointer speedbutton on first tnotebook page. File - NEW FORM now creates a new form with the grid drawn on it. Ability to drop the following components on a form : TButton, TEdit, TRadiobutton, TCheckbox, TListbox, TMemo. TLabel doesn't seem to work yet.

<Snipped>

Shane

I just recompiled Lazarus, and I got the following error:

Fatal: Can't find unit DESIGNERFORM
make.exe[1]: *** [lazarus.exe] Error 1

any ideas? I think you forgot to commit a unit.

Robert Scott Horning Trans-Lux West 1651 North 1000 West Logan, Utah 84321 Phone: (435) 716-8696 FAX: (435) 752-8513 E-mail:

Reply by email

Robert Scott Horning
to Marc Weustink: + + >I was initialy just drawing it but now I'm thinking I should + actually create a…
Marc Weustink wrote 14 lines
Mouse.Cursorpos is given in screen coordinates, not in form coordinates. Onmousedown you store Cursorpos (or better, the given X and Y), onmouseUp you calc the difference with the new Cursorpos (or better, the given X and Y) THe difference is added to the Left and Top. I committed a solution which normally should work, however it doesn't due to a bug in the MouseMove and MouseUp handlers MouseMove / MouseUp should always give the mouseposition X and Y in the Sender coordinates. It does as long as the up event occoured in the control itself. However if you are outside the control you get the X and Y in Form coordinates. Marc

Having done quite a bit of Windows programming, especially with the Mouse Move/Mouse Up events, this is not correct. The coordinates should ALWAYS be in relation to Sender (even if the X & Y are negative... which is possible even for Form or even Screen coordinates.) The problem comes when you try to move something, and as soon as you cross a threshold (like the edge of a control) it jumps suddenly to a totally different location on the monitor. Having made mistakes like this in some of my GUI programming has caused hours of grief when I got the coordinate systems mixed up.

Robert Scott Horning Trans-Lux West 1651 North 1000 West Logan, Utah 84321 Phone: (435) 716-8696 FAX: (435) 752-8513 E-mail:

Reply by email

Marc Weustink
to Shane Miller: I added the following: Click on a VCL speedbutton on the first tnotebook age and it stays…
Show quoted text 9 lines
One cool thing: Click of file and move the mouse over the menu NEW UNIT and press a letter. You will see that letter appear next to the menu. Now move off that menu onto something else. Press the letter you pressed before and that menu function executes (in this case a new unit is created). Odd huh? Not sure why it's doing that.

I think it is default gtk behaviour. I tried it also in the Gimp and gnomine and they allso have this feature.

Marc

Reply by email

Shane Miller
to Shane Miller: I added the following: Click on a VCL speedbutton on the first tnotebook age and it stays…

I updated CVS a few days ago.....(this email failed to send)

I changed the images for the speedbuttons and added accel's to the menu (sort of).

I added the capability to have an underscore in the menu name if you put the "&" sign before a letter. I tried to get the accel's to work then but can't.

One cool thing: Click of file and move the mouse over the menu NEW UNIT and press a letter.
You will see that letter appear next to the menu.

Now move off that menu onto something else.
Press the letter you pressed before and that menu function executes (in this case a new unit is created).

Odd huh? Not sure why it's doing that.

If anyone else wants to look at the accel stuff, feel free.....

Shane

Reply by email

Shane Miller
to Shane Miller

Where is the code that you added for this? I want to see what you changed. ---------------------------------------
Shane Miller
Take a look at other product/projects of mine below!

Get paid to surf the net!
http://alladvantage.com/go.asp?refid=DEX-870

Get paid to surf the net by clicking here too!!!
http://epipo.com/sine.asp?dex870

Home page : http://www.lakefield.net/~smiller

Auto-IP Publisher : http://www.autoip.net

Advanced Clipboard : http://www.lakefield.net/~smiller/advclipboard

Lazarus : http://www.lazarus.freepascal.org

Earlier message 21 lines
----- Original Message ----- From: "Marc Weustink" To: Sent: Wednesday, June 14, 2000 6:44 PM Subject: Re: Menu Accels Was:Re: [lazarus] CVS Changes > At 01:47 14-06-2000 +0200, I wrote: > > >Tomorrow more > > OK I added the accels for the main menu. Submenus doesnt work yet. > > Marc > > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus >

Reply by email

Marc Weustink

Hi, some changes.

I added the pathes from Hans-Joachim Ott:
* Fixed messages in showmodal of 2nd form
the messages weren processed

* Fixed modal result for button
the modalresult wasn't passed to the parent form

* Fixed ModalResult = mrCancel in mainform
the app didn't stop

While processing these I found some dead/obsolete code/messages in gtkobject. I removed/commented out them.

Marc

Reply by email

Marc Weustink
to Shane Miller: Where is the code that you added for this? I want to see what you changed.…

+ From: Shane Miller
+
+ Where is the code that you added for this? I want to see
+ what you changed.

The diff:
http://cvs.freepascal.org/cgi-bin/cvsweb/fpc/lazarus/lcl/interfaces/gtk/gtko bject.inc?r1=1.18&r2=1.19

Look for changes in csMenuBar, csMenuItem and AttachMenu

Pitty that the GTK docs dont have a description of the functns so it is merely a wild guess.

Marc

Reply by email

Shane Miller
to Shane Miller: I added the following: Click on a VCL speedbutton on the first tnotebook age and it stays…

Lazarus needs:

In the environment options dialog (which doesn't exist yet) I need someone to add a selection on whether or not the grid should be drawn. Also the x and y spacing on it.

The variable gridpoints is a tpoint and can be found (at this point) in the designerform unit.

Who is going to do it? It's a good chance for a lurker to get involved......
Thanks
Shane

Reply by email

Chris Bordeman
to Shane Miller: I added the following: Click on a VCL speedbutton on the first tnotebook age and it stays…
However, the component library is usable. You can create applications

from

it at this point using the gtk library through the LCL.

This brings up an issue discussed on borland.public.kylix.non-technical. Since Borland bought part of Troll Tech, "Kylix Delphi" will have no charge for an expensive Qt Commercial License, on any platform. If I write commercial Qt apps with Lazarus, I will have a $1500 license to pay. And since I'll be writing KDE stuff, there goes any price advantage Lazarus may have had.

The data aware components are already there in some cases. I should yeild this answer to someone else but I am aware of some of the components already. I know the interbase components exist...

Good, Interbase is probably all I will need for a while, especially since it is going open source...

I'm not sure what the ELF resource thing is....

I mean using a custom segment (feature of the ELF executable format) for resources. I thought this was how fpc might do resources in the exe.

Chris Bordeman

Reply by email

Shane Miller
to Marc Weustink: + + >I was initialy just drawing it but now I'm thinking I should + actually create a…

OK, I have implemented an early version of dragging controls. Here's a problem though. I also found this problem when I try to align the controls to the grid. The form's Left and Top are not being reported correctly some times.

Press the NEW FORM button.
Select the Button component and drop it onto the form. Drag the button 2 pixels up. It probably moved a little. Now do it again. It doesn't work.
If you look at the output ( in mousedown and mouseup to see what SHOULD be displayed) you'll see that the TOP and LEFT seem to be reported incorrectly.
If you MOVE the form then try it again it's reported correctly. This also occurs when trying to place controls onto the form. Sometimes they appear correctly, sometimes not.
When they dont you can move the form and thn the next one appears correctly.

Any ideas?

Shane

Reply by email

Shane Miller
to Marc Weustink: + + >I was initialy just drawing it but now I'm thinking I should + actually create a…

I agree that if it would send the corrd's based on the sender then this would be much easier. However, by using Mouse.CursorPos I was using the coord's based on the position on the screen. That would work fine but it's a bit tougher to calculate the new location (Take the mouse x , subtract the form's left add the difference between where you clicked ititially and the left of the control).

---------------------------------------
Shane Miller
Take a look at other product/projects of mine below!

Get paid to surf the net!
http://alladvantage.com/go.asp?refid=DEX-870

Get paid to surf the net by clicking here too!!!
http://epipo.com/sine.asp?dex870

Home page : http://www.lakefield.net/~smiller

Auto-IP Publisher : http://www.autoip.net

Advanced Clipboard : http://www.lakefield.net/~smiller/advclipboard

Lazarus : http://www.lazarus.freepascal.org

Earlier message 49 lines
----- Original Message ----- From: "Marc Weustink" To: ; Sent: Wednesday, June 14, 2000 3:48 PM Subject: ControlDragging was: Re: [lazarus] CVS Changes > At 13:30 14-06-2000 -0500, Shane Miller wrote: > > > >Press the NEW FORM button. > >Select the Button component and drop it onto the form. > >Drag the button 2 pixels up. It probably moved a little. Now do it again. > >It doesn't work. > >If you look at the output ( in mousedown and mouseup > >to see what SHOULD be displayed) you'll see that the TOP and LEFT seem to > >be reported incorrectly. > >If you MOVE the form then try it again it's reported correctly. > >This also occurs when trying to place controls onto the form. Sometimes > >they appear correctly, sometimes not. > >When they dont you can move the form and thn the next one appears > >correctly. > > > >Any ideas? > > Mouse.Cursorpos is given in screen coordinates, not in form coordinates. > Onmousedown you store Cursorpos (or better, the given X and Y), > onmouseUp you calc the difference with the new Cursorpos (or better, the > given X and Y) THe difference is added to the Left and Top. > > I committed a solution which normally should work, however it doesn't due > to a bug in the MouseMove and MouseUp handlers > > MouseMove / MouseUp should always give the mouseposition X and Y in the > Sender coordinates. It does as long as the up event occoured in the > control itself. However if you are outside the control you get the X and Y > in Form coordinates. > > Marc > > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus >

Reply by email

Shane Miller

I have added the ability to click on controls and
the "grabbers" appear around them.
�
The grabbers are only drawn on at this point.�
They aren't actually controls of any sort.
�
Please take a look and see if there is anywhere you cxan help out.
�
Thanks

Shane Miller
Take a look at other product/projects of mine below!

Get paid to surf the net!
http://alladvantage.com/go.asp?refid=DEX-870

Get paid to surf the net by clicking here too!!!
http://epipo.com/sine.asp?dex870

Home page : http://www.lakefield.net/~smiller

Auto-IP Publisher : http://www.autoip.net

Advanced Clipboard :
http://www.lakefield.net/~smiller/advclipboard

Lazarus :
http://www.lazarus.freepascal.org

Reply by email

Alexander Reiter
to Marc Weustink: + + >I was initialy just drawing it but now I'm thinking I should + actually create a…

sorry, find another solution:

Procedure TDesignerForm.MouseMove(Sender: TObject; Shift: TShiftState;
X, Y: Integer);
var
  dx, dy: Integer;
begin
  //if TCOntrol(sender).dragging then
  if (FMoveCOntrol.Control = Sender)
  then begin
    dx := X - FMoveCOntrol.X;
    dy := Y - FMoveCOntrol.Y;
    FMoveControl.Control.Left := dX;
    FMoveControl.Control.Top  := dY;
  end;
end;

...sorry for the two unnecessary emails....

br
alex

Alexander Reiter wrote 71 lines
i think the problem is in TDesignerForm.MouseMove. if you try this, you can move your control. well is not the best solution, but it is a good starting point. take a look at this: Procedure TDesignerForm.MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); var dx, dy: Integer; begin //if TCOntrol(sender).dragging then if (FMoveCOntrol.Control = Sender) then begin WriteLn(Format('[TDesignerForm.MouseMove] Start(%d, %d) Stop(%d, %d)', [FMoveCOntrol.X, FMoveCOntrol.Y, X, Y])); not correct --> //dx := X - FMoveCOntrol.X; not correct --> //dy := Y - FMoveCOntrol.Y; dx := X - FMoveControl.Control.Left; dy := Y - FMoveControl.Control.Top; FMoveControl.Control.Left := FMoveControl.Control.Left + dX; FMoveControl.Control.Top := FMoveControl.Control.Top + dY; end; end; br alex Marc Weustink wrote: > > At 13:30 14-06-2000 -0500, Shane Miller wrote: > > >Press the NEW FORM button. > >Select the Button component and drop it onto the form. > >Drag the button 2 pixels up. It probably moved a little. Now do it again. > >It doesn't work. > >If you look at the output ( in mousedown and mouseup > >to see what SHOULD be displayed) you'll see that the TOP and LEFT seem to > >be reported incorrectly. > >If you MOVE the form then try it again it's reported correctly. > >This also occurs when trying to place controls onto the form. Sometimes > >they appear correctly, sometimes not. > >When they dont you can move the form and thn the next one appears > >correctly. > > > >Any ideas? > > Mouse.Cursorpos is given in screen coordinates, not in form coordinates. > Onmousedown you store Cursorpos (or better, the given X and Y), > onmouseUp you calc the difference with the new Cursorpos (or better, the > given X and Y) THe difference is added to the Left and Top. > > I committed a solution which normally should work, however it doesn't due > to a bug in the MouseMove and MouseUp handlers > > MouseMove / MouseUp should always give the mouseposition X and Y in the > Sender coordinates. It does as long as the up event occoured in the > control itself. However if you are outside the control you get the X and Y > in Form coordinates. > > Marc > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Shane Miller

If you are wondering how long it will be until "LAZARUS" will be usable to create applications then I couldn't give you a real good idea. I'm hoping for more help on it and if I get it I could see it becoming usable in a few months.

However, the component library is usable. You can create applications from it at this point using the gtk library through the LCL.

The data aware components are already there in some cases. I should yeild this answer to someone else but I am aware of some of the components already. I know the interbase components exist...

I'm not sure what the ELF resource thing is....

Shane

>> 06/12/00 03:49PM >>>

I was wondering, I have been following the list for a long time, do you guys have a vague idea on how long until Lazarus is usable with a complete set of components (including data aware ones), and the ELF resource thing is implemented and used by Lazarus?

Chris Bordeman

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

Reply by email

Shane Miller

It's there now.

Shane

>> 06/12/00 05:36PM >>>
Shane Miller wrote 6 lines
I added the following: File - NEW FORM now creates a new form with the grid drawn on it. Ability to drop the following components on a form : TButton, TEdit, TRadiobutton, TCheckbox, TListbox, TMemo. TLabel doesn't seem to work yet.

the file ./images/mouse.xpm is missing so lazarus crashes

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: I agree that if it would send the corrd's based on the sender then this would be much…

+ From: Shane Miller
+
+ I agree that if it would send the corrd's based on the sender
+ then this would be much easier. However, by using Mouse.CursorPos I
+ was using the coord's based on the position on the screen.
+ That would work fine but it's a bit tougher to calculate the new
+ location (Take the mouse x, subtract the
+ form's left add the difference between where you clicked
+ ititially and the left of the control).

If you assume that the form won't move while dragging a control, then you don't need the form top and left. Calculate the diffs relative to the screen.

Marc

Reply by email

Shane Miller

Lazarus nneds:

In the environment options dialog (which doesn't exist yet) I need someone to add a selection on whether or not the grid should be drawn. Also the x and y spacing on it.

The variable gridpoints is a tpoint and can be found (at this point) in the designerform unit.

Who is going to do it? It's a good chance for a lurker to get involved...... Thanks
Shane

>> 06/12/00 05:36PM >>>
Shane Miller wrote 6 lines
I added the following: File - NEW FORM now creates a new form with the grid drawn on it. Ability to drop the following components on a form : TButton, TEdit, TRadiobutton, TCheckbox, TListbox, TMemo. TLabel doesn't seem to work yet.

the file ./images/mouse.xpm is missing so lazarus crashes

Marc

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

Reply by email

Marc Weustink
to Marc Weustink: + + >I was initialy just drawing it but now I'm thinking I should + actually create a…
Robert Scott Horning wrote
Having done quite a bit of Windows programming, especially with the Mouse Move/Mouse Up events, this is not correct. The coordinates should ALWAYS be in relation to Sender (even if the X & Y are negative... which is possible even for Form or even Screen coordinates.)

That was what I was trying to say. At this moment lazarus doesn't but it should.

Marc

Reply by email

Shane Miller

I added the following:

Click on a VCL speedbutton on the first tnotebook age and it stays selected. Mouse pointer speedbutton on first tnotebook page.

File - NEW FORM now creates a new form with the grid drawn on it. Ability to drop the following components on a form : TButton, TEdit, TRadiobutton, TCheckbox, TListbox, TMemo. TLabel doesn't seem to work yet.

Needs to be done:

I need a method that I can call to tell the form I added a control and it should return a name (edit1) and place the code in the correct spot in the source.

I need a method that I can DELETE a component by name and the source will be modified.

I need a method I can call when a function get's focus (clicked on) and it draws the sizing "grab blocks" around it.

I need a method I can call passing it a procedure and parameter list (Proceudre FormClick(sender: TObject) and it'll place it in the appropriate spot in the source.

Same thing for deleting the function/method.

Any takers? Otherwise I will have to do them myself.....

Shane

Reply by email

Jeff Wormsley
to Shane Miller: I have added the ability to click on controls and the "grabbers" appear around them. �…
AM Shane Miller wrote
I was initialy just drawing it but now I'm thinking I should actually create a control (6 of them) each time something new gets focus.

Do you need 6 controls? Or one control that ignores events not in one of the 6 areas?

Or would grabbers be part of a control only accesable at design time, and thus defined at the TWinControl level, and thus written once and once only?

Jeff.

Reply by email

Shane Miller
to Marc Weustink: + + >I was initialy just drawing it but now I'm thinking I should + actually create a…

Has anyone determined why these are coming out incorrectly sometimes?

When you drop controls on the form, after a few controls the form's top and left are being reported incorrectly. Ifd you move the form they are correted again.

Anyone look at this?
---------------------------------------
Shane Miller
Take a look at other product/projects of mine below!

Get paid to surf the net!
http://alladvantage.com/go.asp?refid=DEX-870

Get paid to surf the net by clicking here too!!!
http://epipo.com/sine.asp?dex870

Home page : http://www.lakefield.net/~smiller

Auto-IP Publisher : http://www.autoip.net

Advanced Clipboard : http://www.lakefield.net/~smiller/advclipboard

Lazarus : http://www.lazarus.freepascal.org

Earlier message 49 lines
----- Original Message ----- From: "Marc Weustink" To: ; Sent: Wednesday, June 14, 2000 3:48 PM Subject: ControlDragging was: Re: [lazarus] CVS Changes > At 13:30 14-06-2000 -0500, Shane Miller wrote: > > > >Press the NEW FORM button. > >Select the Button component and drop it onto the form. > >Drag the button 2 pixels up. It probably moved a little. Now do it again. > >It doesn't work. > >If you look at the output ( in mousedown and mouseup > >to see what SHOULD be displayed) you'll see that the TOP and LEFT seem to > >be reported incorrectly. > >If you MOVE the form then try it again it's reported correctly. > >This also occurs when trying to place controls onto the form. Sometimes > >they appear correctly, sometimes not. > >When they dont you can move the form and thn the next one appears > >correctly. > > > >Any ideas? > > Mouse.Cursorpos is given in screen coordinates, not in form coordinates. > Onmousedown you store Cursorpos (or better, the given X and Y), > onmouseUp you calc the difference with the new Cursorpos (or better, the > given X and Y) THe difference is added to the Left and Top. > > I committed a solution which normally should work, however it doesn't due > to a bug in the MouseMove and MouseUp handlers > > MouseMove / MouseUp should always give the mouseposition X and Y in the > Sender coordinates. It does as long as the up event occoured in the > control itself. However if you are outside the control you get the X and Y > in Form coordinates. > > Marc > > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus >

Reply by email

Marc Weustink
to Jeff Wormsley: Do you need 6 controls? Or one control that ignores events not in one of the 6 areas? Or…

+ On 06/14/2000 at 10:03 AM Shane Miller wrote:
+
+ >I was initialy just drawing it but now I'm thinking I should
+ actually create a control (6 of them) each time something new
+ gets focus.
+
+ Do you need 6 controls? Or one control that ignores events
+ not in one of the 6 areas?

??? 6 ??? IMO you need 8

+ Or would grabbers be part of a control only accesable at
+ design time, and thus defined at the TWinControl level, and
+ thus written once and once only?

Or are they part of the designer form. I myself don't feel for an implementation in TWincontrol. It's a design feature not a runtime.

They are drawn by the form at this moment so the form can check which one is grabbed.

BTW, Delphi 4 creates 8 TGrabHandle windows as child of the design form

Hmm.... thinking of this, I've somewhere a piece of code which defines and implements grabhandles. I can use/commit/publis this if we want ?

Marc

Reply by email

Alexander Reiter
to Marc Weustink: + + >I was initialy just drawing it but now I'm thinking I should + actually create a…

hi, again:

i correct something, use:

 dx := X - (FMoveControl.Control.Left + FMoveControl.X);
 dy := Y - (FMoveControl.Control.Top + FMoveControl.Y);

br
alex

Show quoted text 6 lines
i think the problem is in TDesignerForm.MouseMove. if you try this, you can move your control. well is not the best solution, but it is a good starting point. take a look at this: Procedure TDesignerForm.MouseMove(Sender: TObject; Shift: TShiftState;
X, Y: Integer);
var
  dx, dy: Integer;
begin
  //if TCOntrol(sender).dragging then
  if (FMoveCOntrol.Control = Sender)
  then begin
    WriteLn(Format('[TDesignerForm.MouseMove] Start(%d, %d) Stop(%d,
%d)', [FMoveCOntrol.X, FMoveCOntrol.Y, X, Y]));
  not correct  --> //dx := X - FMoveCOntrol.X;
  not correct  --> //dy := Y - FMoveCOntrol.Y;
     dx := X - FMoveControl.Control.Left;
     dy := Y - FMoveControl.Control.Top;
    FMoveControl.Control.Left := FMoveControl.Control.Left + dX;
    FMoveControl.Control.Top  := FMoveControl.Control.Top + dY;
  end;
end;

br
alex

Marc Weustink wrote 37 lines
At 13:30 14-06-2000 -0500, Shane Miller wrote: >Press the NEW FORM button. >Select the Button component and drop it onto the form. >Drag the button 2 pixels up. It probably moved a little. Now do it again. >It doesn't work. >If you look at the output ( in mousedown and mouseup >to see what SHOULD be displayed) you'll see that the TOP and LEFT seem to >be reported incorrectly. >If you MOVE the form then try it again it's reported correctly. >This also occurs when trying to place controls onto the form. Sometimes >they appear correctly, sometimes not. >When they dont you can move the form and thn the next one appears >correctly. > >Any ideas? Mouse.Cursorpos is given in screen coordinates, not in form coordinates. Onmousedown you store Cursorpos (or better, the given X and Y), onmouseUp you calc the difference with the new Cursorpos (or better, the given X and Y) THe difference is added to the Left and Top. I committed a solution which normally should work, however it doesn't due to a bug in the MouseMove and MouseUp handlers MouseMove / MouseUp should always give the mouseposition X and Y in the Sender coordinates. It does as long as the up event occoured in the control itself. However if you are outside the control you get the X and Y in Form coordinates. Marc _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Chris Bordeman
to Unknown author: True if you juste use the CLX but if you want to use the QT API by your-self it is not…
>This brings up an issue discussed on borland.public.kylix.non-technical. >Since Borland bought part of Troll Tech, "Kylix Delphi" will have no

charge

>for an expensive Qt Commercial License, on any platform. If I write >commercial Qt apps with Lazarus, I will have a $1500 license to pay. And >since I'll be writing KDE stuff, there goes any price advantage Lazarus

may

>have had. True if you juste use the CLX but if you want to use the QT API by

your-self

it is not abviouse at this time that it would be allowed by the Borland/TrollTech crosslicense. This is a point that need enlightment.

According to a Borland guy on the ng, if you are using Delphi or C++ Builder to create commercial apps on Linux, the _only_ way you would be allowed to access Qt would be through their straight 'C' interface layer, yes even in BCB. Any function not exposed to by the C layer or through the VCL or CLX could not be used. This an absolutely _brilliant_ way of getting the bulk of Qt commercial developers (and therefore eventually OSS developers) to use Borland products. Adding the CLX as a portable pathway between Linux and Windows, well, it is a helluva strategy.

Go Borland!

Chris Bordeman
Developer, EMI

Reply by email

Shane Miller
to Shane Miller: I have added the ability to click on controls and the "grabbers" appear around them. �…

Question:
Does anyone have a good idea on how I should create the "grabber" around a control to show it has focus in the designer and allow them to resize it? I was initialy just drawing it but now I'm thinking I should actually create a control (6 of them) each time something new gets focus. That way the grabber will actually get the mouse move events and such so I can change the cursor and get the mouse click events. Does anyone have a bright idea or is this way good? Shane<FONT color=#000000
size=2>

Reply by email

Unknown author
you wrote 6 lines
This brings up an issue discussed on borland.public.kylix.non-technical. Since Borland bought part of Troll Tech, "Kylix Delphi" will have no charge for an expensive Qt Commercial License, on any platform. If I write commercial Qt apps with Lazarus, I will have a $1500 license to pay. And since I'll be writing KDE stuff, there goes any price advantage Lazarus may have had.

True if you juste use the CLX but if you want to use the QT API by your-self it is not abviouse at this time that it would be allowed by the Borland/TrollTech crosslicense. This is a point that need enlightment.

Vital Tremblay

Reply by email

Shane Miller
to Marc Weustink: + From: Shane Miller + + I agree that if it would send the corrd's based on the sender +…

Marc,

I looked at your code for the TGrabber. I didn't look it over real wel but it looks usable.

You want to convert it?

Earlier message 28 lines
----- Original Message ----- From: Marc Weustink To: Sent: Thursday, June 15, 2000 3:25 AM Subject: RE: ControlDragging was: Re: [lazarus] CVS Changes > + From: Shane Miller > + > + I agree that if it would send the corrd's based on the sender > + then this would be much easier. However, by using Mouse.CursorPos I > + was using the coord's based on the position on the screen. > + That would work fine but it's a bit tougher to calculate the new > + location (Take the mouse x, subtract the > + form's left add the difference between where you clicked > + ititially and the left of the control). > > If you assume that the form won't move while dragging a control, then you > don't need the form top and left. Calculate the diffs relative to the > screen. > > Marc > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus >

Reply by email

Stefan Hille

Hi,

just changed the following things:

- gtkobject.inc:
- made SetText work for ComboBox
- removed superfluous code for LM_GetText in IntSendMessage3
- cleaned up code for LM_SETSEL & LM_SETSELMODE

- customcombobox.inc
- removed superfluous code/comments for Get/SetText
- Fixed bug in range check in SetItemIndex

- stdctrls.pp
- removed some old comments in decl. of TCustomCheckBox

For some strange reason I could not specify a logmessage about these changes, sorry ....

bye,

Stefan

--------------------------------------------------------- Stefan Hille email: 48155 Muenster voice: 0251/664695

Reply by email

Stefan Hille

Hi,

I've updated the following files:

- extctrls.pp
*Important*
reintroduced TAbstractReader=Treader hack to match current fcl-implementation

- stdctrls.pp

minor improvements to TComboBox

- customcombobox.inc
minor improvements to TComboBox

- gtkobject.inc
minor cleanups

bye,

Stefan

--------------------------------------------------------- Stefan Hille email: 48155 Muenster voice: 0251/664695

Reply by email