Recent

Author Topic: Aesthetic bugfix of Lazarus's Component Palette  (Read 32112 times)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5635
    • wiki
Re: Aesthetic bugfix of Lazarus's Component Palette
« Reply #30 on: April 28, 2014, 11:55:17 pm »
Code: [Select]
Another reason is there are no such OnClick.Speedbutton has an onClick. But of course the change would need testing. And yes it would be (much) more work.

Anyway, in order for me to accept a patch, I must be convinced it has a certain (basic) correctness.

Of course I am not the only judge to that. If any other member of the team believes that the patch is good, then they can apply it. (I will not stop them, but I will make them aware of my concerns. If they think my concerns are unwarranted, then fine.)

I told you what I think. It is up to you to run this with other team members. You find more of them on the mail list.

The rest of the team may have different opinions. I do not know.
« Last Edit: April 28, 2014, 11:57:37 pm by Martin_fr »

taazz

  • Hero Member
  • *****
  • Posts: 5363
Re: Aesthetic bugfix of Lazarus's Component Palette
« Reply #31 on: April 29, 2014, 01:00:23 am »
Hi guys,
About multi-row implemenation of Component Palette, what's your oppinion about CodeLite ?
http://hative.com/wp-content/uploads/2013/10/free-ides/free-ide-codelite-6.jpg
It looks like the newer Delphi horizontal palette I don't dislike it per see but it makes me grind my teeth a bit. I guess I'll get used to it in time.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Bart

  • Hero Member
  • *****
  • Posts: 3518
    • Bart en Mariska's Webstek
Re: Aesthetic bugfix of Lazarus's Component Palette
« Reply #32 on: April 29, 2014, 01:22:20 am »
Oh, please NO!

Bart

x2nie

  • Sr. Member
  • ****
  • Posts: 478
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
Re: Aesthetic bugfix of Lazarus's Component Palette
« Reply #33 on: April 29, 2014, 02:05:16 am »
Code: [Select]
Another reason is there are no such OnClick.Speedbutton has an onClick. But of course the change would need testing. And yes it would be (much) more work.

Anyway, in order for me to accept a patch, I must be convinced it has a certain (basic) correctness.
I mean in ComponentPalette.pas, the component-buttons (TSpeedBUtton) are not using OnClick.


Oh yeah, you know it need more test. I am in the middle getting a try of several solution of keeping the arrow-button in home while scrollbox being scrolled.
IMHO your second option (create new TScrollBox class) seem would be the best rather than first option (move arrow-button outside the scrollbox).
When It were done, I will send the patch.


@Taazz, @Bart: ha ha ha! that is funny. I never know in before, if Delphi could be like that.
Thanks!
When you were logged in, you can see attachments.
Lazarus Trunk @ Windows7 64bit, XP 32bit, Debian under VirtualMachine

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5635
    • wiki
Re: Aesthetic bugfix of Lazarus's Component Palette
« Reply #34 on: April 29, 2014, 02:21:25 am »
They do not have to use OnClick

The onClick simple needs the code to set (they can do it in on mouse down too)
 ActiveSpeedButtonInOtherParent.Down := False;

To simulate they are in one group.

Then of course anything that accesses TheTabsheet.Controls must adjust the index by one, as one item is no longer in there.




--
If  you look at TScrollBox, it uses ScrollWindow (google msdn + scrollwindow), so it needs less repaint.

However for the component palette, and given that this is fairly small, this is not a must.
« Last Edit: April 29, 2014, 02:33:33 am by Martin_fr »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5635
    • wiki
Re: Aesthetic bugfix of Lazarus's Component Palette
« Reply #35 on: April 29, 2014, 02:33:02 am »
Here goes how seldom I use the designer, there is Menu > View > Components an alternative way to access the palette.
« Last Edit: April 29, 2014, 02:35:10 am by Martin_fr »

x2nie

  • Sr. Member
  • ****
  • Posts: 478
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
Re: Aesthetic bugfix of Lazarus's Component Palette
« Reply #36 on: April 29, 2014, 02:46:21 am »
Here goes how seldom I use the designer, there is Menu > View > Components an alternative way to access the palette.
That dialog can also be accessed via right-click on component button, and then "View All" on pupup menu.




Martin, I have problem:
In ComponentPalette.pas (ide.lpk) I added this:





Code: [Select]
type


  { TScrollBox }
 
  //Helper class (interceptor) used for keeping first button always in home when scrolled
  TScrollBox = class(Forms.TScrollBox)
  private
    FOnScroll: TNotifyEvent;
  protected
    procedure WMVScroll(var Message : TLMVScroll); message LM_VScroll;
  public
    property OnScroll : TNotifyEvent read FOnScroll write FOnScroll;
  end;   


Then error occurred in compiling with message: Identifier not found "TLMVScroll".
But IDE package doesn't depends on LCL package.
In your oppinion, in where unit/package I should declare that class?


PS:
  Now I know whats you refer to
So the best way is to move the item out of the scrollbox, and Add OnClick events to all buttons, simulating correct up/down behaviour.

Otherwise you need to implement a scrollbox for which you can control when and how scrolling happens. That will be more work.

Feel free to discuss that, if/before you want to to anything on it.

When you were logged in, you can see attachments.
Lazarus Trunk @ Windows7 64bit, XP 32bit, Debian under VirtualMachine

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5635
    • wiki
Re: Aesthetic bugfix of Lazarus's Component Palette
« Reply #37 on: April 29, 2014, 03:40:43 am »
Quote
But IDE package doesn't depends on LCL package.
The IDE is not a package. It is a project (and as such depends on LCL)

At least on Windows LM_VScroll will be before the scroll.

The worry is gtk2. There are so many gtk2 versions... But I am not a gtk2 expert.

x2nie

  • Sr. Member
  • ****
  • Posts: 478
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
Re: Aesthetic bugfix of Lazarus's Component Palette
« Reply #38 on: April 29, 2014, 03:52:47 am »
Quote
But IDE package doesn't depends on LCL package.
The IDE is not a package. It is a project (and as such depends on LCL)
come on...  there is  \lazarus\ide\ide.lpk; it depends of SynEdit, codetools, IDEIntf.
I think there was a reason to keep it not depend to LCL directly.




But I aborted to use it, and now trying another solution: to move arrow-button (it named SelectButton) to outside of scrollbox.
Okay, don't worry. Let forget it.
 8-)



When you were logged in, you can see attachments.
Lazarus Trunk @ Windows7 64bit, XP 32bit, Debian under VirtualMachine

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5635
    • wiki
Re: Aesthetic bugfix of Lazarus's Component Palette
« Reply #39 on: April 29, 2014, 04:17:41 am »
Ok, you should work on trunk, so your patch will not miss out changes in trunk.

In trunk ide.lpk does not exist any more.

ide.lpk, was a temp solution, that was ONLY for compiling the debugger test case.


Please open ied/lazarus.lpi, and ignore the package

x2nie

  • Sr. Member
  • ****
  • Posts: 478
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
Re: Aesthetic bugfix of Lazarus's Component Palette
« Reply #40 on: April 29, 2014, 04:37:56 am »
Is it? Ah, How idiot I am.


So, I have arrived on my bottom line.


I did it: copy-paste per file required from trunk --> to C:\Lazarus  %) :P
Oops!
I don't know how to compile Lazarus source code. Really.

Is there a link I can follow to compile Lazarus from source code in better way?
(sorry, if its out of topic).

Thanks you.
When you were logged in, you can see attachments.
Lazarus Trunk @ Windows7 64bit, XP 32bit, Debian under VirtualMachine

x2nie

  • Sr. Member
  • ****
  • Posts: 478
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
Re: Aesthetic bugfix of Lazarus's Component Palette
« Reply #41 on: April 29, 2014, 05:04:16 am »
Is there a link I can follow to compile Lazarus from source code in better way?
It's not because I am lazy. It was because I failed in early trying.


Oke, I found a great and easy step I could follow within \Lazarus\Docs\Install.txt :
Quote
3.1 Installing Lazarus under Windows:
...


  You have to download the Lazarus source:
  ftp://ftp.freepascal.org/pub/fpc/source/lazarus.zip


  Then unzip it to c:\lazarus for example.
  You have to install at least FPC 2.6.2, e.g. in
   c:\pp\bin\win32.
   In this directory you can find a lot of exes (make, grep, ppc386, and so on).

  Open a command line. Start->Run...>command or choose MS-DOS icon.
  Type:
  cd c:\lazarus
   rem of course adjust to your path:
  set path=c:\pp\bin\win32;c:\lazarus 
  make

  If you are lucky then you can type: lazarus.exe 
8-)
« Last Edit: April 29, 2014, 05:14:37 am by x2nie »
When you were logged in, you can see attachments.
Lazarus Trunk @ Windows7 64bit, XP 32bit, Debian under VirtualMachine

taazz

  • Hero Member
  • *****
  • Posts: 5363
Re: Aesthetic bugfix of Lazarus's Component Palette
« Reply #42 on: April 29, 2014, 05:22:52 am »
1) to build lazarus you have 2 choices
  a) open the file "<LAzarus_Install_Dir>\IDE\Lazarus.lpi" as martin already suggested and press build.
  b) use the menu "tools\Build Lazarus" inside your IDE.

2) Never rely on .zip files when trying to create a patch or work on some code it is better to check out the source directly from the SVN repository use turtoiseSVN its the easiest svn client, just right click on a folder and select svn checkout type in the svn server and you are good to go even for patch creation.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

x2nie

  • Sr. Member
  • ****
  • Posts: 478
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
Re: Aesthetic bugfix of Lazarus's Component Palette
« Reply #43 on: April 29, 2014, 06:01:07 am »

Hi taazz!
Yes, I am familiar with Tortoise. And I have a good and small patch here.

------------
I will be happy to discuss and help getting a patch into SVN that will keep the "selection cursor" item visible, if lines are scrolled.
But the current approach (adjusting top in OnPaint is wrong) At the time of any event from the scrollbox it is to late to update the top coordinate.

E.g. on Win32 ScrollBox uses the WinApi call "ScrollWindow" which acts immediately. So the scroll will be visible on the screen, before you can change the top coordinate.

On fast computers that may not be noticeable. But on slower PC that will flicker. (There is also a bug, that may currently prevent or reduce flicker, but once that gets fixed ...)

So the best way is to move the item out of the scrollbox, and Add OnClick events to all buttons, simulating correct up/down behaviour.

Otherwise you need to implement a scrollbox for which you can control when and how scrolling happens. That will be more work.

Feel free to discuss that, if/before you want to to anything on it.


Hi Martin.
I did your both 2 solution.
1. Moving the SelectButton outside the scrollbox is terrible. it requires too much hack, and I were not satisfied with the result.
2. Inheriting the TScrollBox is easier to do, easier to learn, easier to track the changes made to the code.
    It is done by interceptor (Same class name as it's ancestor).
    And it seem you wouldn't worry about GTK, IMHO ScrollBy would implement by all widgetset; but I don't know for sure.



When you were logged in, you can see attachments.
Lazarus Trunk @ Windows7 64bit, XP 32bit, Debian under VirtualMachine

x2nie

  • Sr. Member
  • ****
  • Posts: 478
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
Re: Aesthetic bugfix of Lazarus's Component Palette
« Reply #44 on: April 29, 2014, 06:04:05 am »
What's next ?
When you were logged in, you can see attachments.
Lazarus Trunk @ Windows7 64bit, XP 32bit, Debian under VirtualMachine