* * *

Author Topic: Eye Candy Controls  (Read 19842 times)

Blaazen

  • Hero Member
  • *****
  • Posts: 2663
  • POKE 54296,15
    • Eye-Candy Controls
Re: Eye Candy Controls
« Reply #15 on: May 13, 2014, 11:16:12 pm »
I updated EC Controls to version 0.0.1.9. This version repairs some (mainly optical) issues. Again, you can download from:
SourceForge: https://sourceforge.net/projects/eccontrols/files/ecc_14-05-13/?
MediaFIre: https://www.mediafire.com/folder/ba7e10gy3bty3/14-05-13

Changelog:

TECColorCombo now displays correctly items (closed and dropped-down normal/selected) in Win32/Qt4/GTK2.
(Reason: Canvas.Font.Color and Canvas.Brush.Color wasn't set properly to clWindowText, clHighlightText, clWindow and clHighlight).

Added small abstract class TBaseScrollControl to unit ECTypes. It manages scrollbars only.

Added glyphs egdSizeArrUp, egdSizeArrRight, egdSizeArrDown and egdSizeArrLeft to TGlyphDesign (and implemented in TCanvasHelper class).

Improved calculation of InvalidateRect of TCustomECGrpCtrls when Orientation = eooVertical.

TBaseECSlider (and descendants) are now created with DoubleBuffered = True.
(Reason: some users experienced flickering.)

Methods Resize(); are replaced with message methods WMSize(); (TCustomECSpeedBtn, TCustomECSwitch, TCustomECRuler, TBaseECSlider, TCustomECGrpCtrls).
(Reason: Better optimalized code. LCL triggers more Resize(); and less WMSize();.)

In TCustomECImageMenu.DrawItem() is (odSelected in State) replaced with Focused. It repairs calculation of item-background color in GTK2.
(Reason: (odSelected in State) does not work in GTK2.)

Improved repainting of TCustomECSpeedBtn and TCustomECRuler when these components are resized in GTK2.
(Reason: GTK2 needs extra Invalidate; on resizing, while Qt4 invalidates automatically.)                                   
Lazarus 2.1.0 r59474M FPC 3.3.1 r40247 x86_64-linux-qt Chakra, Qt 4.8.7/5.11.2, Plasma 5.14.2
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.14

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

inforplasta

  • New member
  • *
  • Posts: 17
Re: Eye Candy Controls
« Reply #16 on: May 16, 2014, 06:00:22 pm »
I have installed succesfully in Linux (GTK), and tested with no troubles at this moment.
I'm trying now to evaluate OS/X compatibility and this is the result: (OS/X 10.7, Lazarus 1.3, FPC 2.6)
-No troubles at installation, Lazarus builds ok.
-TECSpinBtns and TECSpinEdit makes Lazarus crash (when trying to put a component in a form)
-TECSwitch and TECSlider: message "Error moving component" when trying to put them in a form
-TECImageMenu, TECSpinController, TECTimer, TECSpeedBtn, TECEditBtn,TECColorBtn,
TECComboBtn, TECColorCombo,   TECProgressBar, TECPositionBar, TECRuler, TECRadioGroup,
TECCheckGroup: work aparently ok (only trivial test now)

If you need any specific test in Linux/Windows/OS-X, I'm available

Blaazen

  • Hero Member
  • *****
  • Posts: 2663
  • POKE 54296,15
    • Eye-Candy Controls
Re: Eye Candy Controls
« Reply #17 on: May 16, 2014, 06:25:12 pm »
Quote
-TECSpinBtns and TECSpinEdit makes Lazarus crash (when trying to put a component in a form)
-TECSwitch and TECSlider: message "Error moving component" when trying to put them in a form

Damn!

OK. Some first ideas.

Both TECEditBtn and TECSpinEdit are basically TEdit+associated component (TCustomControl descendant). If the first is OK while the other crashes then the problem comes probably from TECSpinBtns. Maybe solution should be to move some sensitive code (Height := 23;? CalcInternalGeometry;? ) from constructor to InitializeWnd().

TECSwitch and TECSlider are both descendants of TECBaseControl (just like TECProgressBar and TECPositionBar whose don't crash). The only difference is that they contain subclass TCustomECKnob - but it's just a TPersistant.
Maybe move method ResizeKnob (TECSwitch) also from constructor to IntializeWnd. Currently have no idea about TECSlider.
Lazarus 2.1.0 r59474M FPC 3.3.1 r40247 x86_64-linux-qt Chakra, Qt 4.8.7/5.11.2, Plasma 5.14.2
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.14

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

inforplasta

  • New member
  • *
  • Posts: 17
Re: Eye Candy Controls
« Reply #18 on: May 16, 2014, 09:03:41 pm »
Both TECEditBtn and TECSpinEdit are basically TEdit+associated component (TCustomControl descendant). If the first is OK while the other crashes then the problem comes probably from TECSpinBtns. Maybe solution should be to move some sensitive code (Height := 23;? CalcInternalGeometry;? ) from constructor to InitializeWnd().

Commented CalcInternalGeometry at TCustomSpinBtns.Create, and component can be inserted but without buttons. Tried FSpinBtns.CalcInternalGeometry at TECSpinEdit.InitializeWnd, and Lazarus crashes again.
« Last Edit: May 16, 2014, 09:05:36 pm by inforplasta »

Blaazen

  • Hero Member
  • *****
  • Posts: 2663
  • POKE 54296,15
    • Eye-Candy Controls
Re: Eye Candy Controls
« Reply #19 on: May 16, 2014, 09:26:17 pm »
Thank you. I can't see anything wrong at CalcInternalGeometry. However, I forgotten replace method Resize with WMSize. It wasn't wrong (it works on QT, GTK2 and Win32) but maybe Carbon is sensitive on it. Resize is called even if Handle is not yet allocated while WMSize not.

Can you try add:

if not HandleAllocated then exit;

after inherited Resize; in Resize(); method ? I hope that's it.

I'll replace the Resize method with WMSize(); in next release anyway.
Lazarus 2.1.0 r59474M FPC 3.3.1 r40247 x86_64-linux-qt Chakra, Qt 4.8.7/5.11.2, Plasma 5.14.2
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.14

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

inforplasta

  • New member
  • *
  • Posts: 17
Re: Eye Candy Controls
« Reply #20 on: May 16, 2014, 09:32:25 pm »
TECSwitch and TECSlider are both descendants of TECBaseControl (just like TECProgressBar and TECPositionBar whose don't crash). The only difference is that they contain subclass TCustomECKnob - but it's just a TPersistant.
Maybe move method ResizeKnob (TECSwitch) also from constructor to IntializeWnd. Currently have no idea about TECSlider.

Trying to create an TECSwitch at runtime, it appears exception 'FpImageException' - Invalid Size. Same with or without Resizeknob (at constructor). But, finally, despite error, component appears and it works.

inforplasta

  • New member
  • *
  • Posts: 17
Re: Eye Candy Controls
« Reply #21 on: May 16, 2014, 09:44:02 pm »
Can you try add:

if not HandleAllocated then exit;

after inherited Resize; in Resize(); method ? I hope that's it.

Thank you, but... Same result, Lazarus crashes.

Blaazen

  • Hero Member
  • *****
  • Posts: 2663
  • POKE 54296,15
    • Eye-Candy Controls
Re: Eye Candy Controls
« Reply #22 on: May 16, 2014, 10:05:57 pm »
Quote
Trying to create an TECSwitch at runtime, it appears exception 'FpImageException' - Invalid Size. Same with or without Resizeknob (at constructor). But, finally, despite error, component appears and it works.

I can only guess, maybe bitmap needs to have some non-zero size before setting other parameters in Carbon. Can you copy-paste content of Call Stack?

Can you try add:

if not HandleAllocated then exit;

after inherited Resize; in Resize(); method ? I hope that's it.

Thank you, but... Same result, Lazarus crashes.

No idea. Carbon is mystery for me.
Lazarus 2.1.0 r59474M FPC 3.3.1 r40247 x86_64-linux-qt Chakra, Qt 4.8.7/5.11.2, Plasma 5.14.2
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.14

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

Blaazen

  • Hero Member
  • *****
  • Posts: 2663
  • POKE 54296,15
    • Eye-Candy Controls
Re: Eye Candy Controls
« Reply #23 on: May 17, 2014, 01:47:06 pm »
Some googling around: http://bugs.freepascal.org/view.php?id=23112
It's exactly the error message you get and reading Pixels[x,y] is exactly what I use for painting dots/lines on the Knob.
Resolving this issue maybe repair TECSwitch and TECSlider.
Lazarus 2.1.0 r59474M FPC 3.3.1 r40247 x86_64-linux-qt Chakra, Qt 4.8.7/5.11.2, Plasma 5.14.2
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.14

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

inforplasta

  • New member
  • *
  • Posts: 17
Re: Eye Candy Controls
« Reply #24 on: May 17, 2014, 08:36:19 pm »
Some googling around: http://bugs.freepascal.org/view.php?id=23112
It's exactly the error message you get and reading Pixels[x,y] is exactly what I use for painting dots/lines on the Knob.
Resolving this issue maybe repair TECSwitch and TECSlider.
That must be the reason, because I have just created a tecswitch at runtime assigning knob.tickmarkcount:=0 and after that I could assign a parent to it and use it with no troubles.
Thanks again

Blaazen

  • Hero Member
  • *****
  • Posts: 2663
  • POKE 54296,15
    • Eye-Candy Controls
Re: Eye Candy Controls
« Reply #25 on: May 17, 2014, 08:56:50 pm »
OK, at least we now know where is the reason.

Now remains TECSpinBtns. I may have the same reason, glyphs are painted with TCanvasHelper and it uses sometimes Pixels[] too, for example egdArrowDec and egsArrowInc do so, and they are default.

I used Pixels[] because sometimes, because when you draw Line from x1,y1 to x2,y2 (when x1>x2 or y2>y1) Qt slightly (1 pixel) differs from GTK2 so I use it for correction.
Lazarus 2.1.0 r59474M FPC 3.3.1 r40247 x86_64-linux-qt Chakra, Qt 4.8.7/5.11.2, Plasma 5.14.2
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.14

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

CM630

  • Hero Member
  • *****
  • Posts: 846
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: Eye Candy Controls
« Reply #26 on: October 25, 2017, 01:46:33 pm »
Hi.
On the latest version (or so I think) I came across the following bug:

1. Create a new TECTabCtrl from the IDE.
2. Create two new tabs by right mouse click over the tab control->AddTab
3. Delete last tab by selecting 1- Tab1: TecTab in the Components panel of the IDE and pressing DEL on the keyboard.

After building an app, after placing the mouse over the form or the tab, I get an exception "List Index(1) out of bounds..."
Лазар 1,8,2;W7 64bit or XP 32bit;FPC3,0,4;rev 57369

Blaazen

  • Hero Member
  • *****
  • Posts: 2663
  • POKE 54296,15
    • Eye-Candy Controls
Re: Eye Candy Controls
« Reply #27 on: October 25, 2017, 02:02:41 pm »
Confirmed.
Lazarus 2.1.0 r59474M FPC 3.3.1 r40247 x86_64-linux-qt Chakra, Qt 4.8.7/5.11.2, Plasma 5.14.2
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.14

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

CM630

  • Hero Member
  • *****
  • Posts: 846
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: Eye Candy Controls
« Reply #28 on: November 03, 2017, 09:23:21 am »

I came across another issue with TECTabCtrl.
When I do:
Case 1: ECTabCtrl1.Tabs.Delete(0); the OnChange and OnChanging events are not fired.
Case 2: But when I close a tab from the close botton on itself the OnChange and OnChanging are fired.


My expectation is that they shall not be fired in both cases.


But if I am wrong, how could I prevent them firing in the Case 2? I could store a variable in the OnCloseTabClick event (and check it in OnChange, before exuting its contents), but maybe there is a more standard solution? Also OnCloseTabClick might get fired more than once, which makes solution with a variable harder.
« Last Edit: November 03, 2017, 12:12:31 pm by CM630 »
Лазар 1,8,2;W7 64bit or XP 32bit;FPC3,0,4;rev 57369

Bart

  • Hero Member
  • *****
  • Posts: 3128
    • Bart en Mariska's Webstek
Re: Eye Candy Controls
« Reply #29 on: November 03, 2017, 03:40:57 pm »
Wether a control fires OnChange when the change is done programatically is rahthe rirratic, some do, some don't (as is the case in Delphi).
OnChange should IMO be fired upon user interaction (case 2).

Bart

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus