Recent

Author Topic: Custom Drawn Controls advances  (Read 154926 times)

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Custom Drawn Controls advances
« Reply #90 on: January 24, 2012, 07:59:15 am »
Thanks, applied in rev34890 and I also add Enabled to all controls (I could have forgotten one or two, however).

The only issue with the patch was the identation. It started with 4 spaces in the first level, please keep all patches in the standard LCL identation: 2 spaces for each level. thanks =)

circular

  • Hero Member
  • *****
  • Posts: 4369
    • Personal webpage
Re: Custom Drawn Controls advances
« Reply #91 on: January 24, 2012, 07:34:19 pm »
This looks great !
Conscience is the debugger of the mind

TurboRascal

  • Hero Member
  • *****
  • Posts: 672
  • "Good sysadmin. Bad programmer."™
Re: Custom Drawn Controls advances
« Reply #92 on: January 25, 2012, 12:12:11 am »
The way this is developing it seems to me that Lazarus might be able to create apps for even more platforms using custom drawn controls. Perhaps even for DOS ;)
Regards, ArNy the Turbo Rascal
-
"The secret is to give them what they need, not what they want." - Scotty, STTNG:Relics

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11984
  • FPC developer.
Re: Custom Drawn Controls advances
« Reply #93 on: February 06, 2012, 11:34:55 am »
The way this is developing it seems to me that Lazarus might be able to create apps for even more platforms using custom drawn controls. Perhaps even for DOS ;)

The Java way. Portable to all systems, but native on none.  Maybe we can translate SWING :-)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Custom Drawn Controls advances
« Reply #94 on: February 06, 2012, 11:57:57 am »
The way this is developing it seems to me that Lazarus might be able to create apps for even more platforms using custom drawn controls. Perhaps even for DOS ;)
Mmm. I WANT my Linux/FreeBSD ncurses+Windows CMD.EXE custom drawn labels, edit boxes, comboboxes, radiogroups and buttons ;)

(Yes, FreeVision/Novell Netware style programming ftw  :)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Custom Drawn Controls advances
« Reply #95 on: February 06, 2012, 01:17:03 pm »
The Java way. Portable to all systems, but native on none.  Maybe we can translate SWING :-)

You are exagerating, probably based on lack of knowledge. I assume you never actually tested LCL-CustomDrawn. It does almost exactly the same as what Qt does, which is not exactly same as what Java with for example Swing does. Swing is slow, does not work in any mobile platform and looks like crap everywhere, but Qt is skinnable and imitates native widgets so good that you can't tell the difference. CustomDrawn is also skinnable and I already immitate pixel-by-pixel Windows 2000 controls. Lainz is doing a good job with a Windows 7 look and I already started the Android and Windows CE looks.

If it looks exactly the same, pixel-by-pixel why do you say it isn't native? The native API also draws the same pixels on the screen. What difference does it make if the native API draws them or if the LCL draws them?

And to complete: I wonder if you also have the same oppinion of Qt? That it is the same as Swing?

circular

  • Hero Member
  • *****
  • Posts: 4369
    • Personal webpage
Re: Custom Drawn Controls advances
« Reply #96 on: February 06, 2012, 05:33:54 pm »
felipemdc, I suppose you did not understand what marcov was saying. If you draw a component by yourself, it is not native. BGRAControls are not native, anything that is not already there in the operating system is not native.

About Swing, I suppose marcov means hat we could program the same rendering as Swing, so that a Java user interface could be cloned. In your way of thinking, it would be just another drawer.

Of course, there is another difference about Java and Framework.NET, which is the virtual machine.
Conscience is the debugger of the mind

TurboRascal

  • Hero Member
  • *****
  • Posts: 672
  • "Good sysadmin. Bad programmer."™
Re: Custom Drawn Controls advances
« Reply #97 on: February 06, 2012, 06:19:05 pm »
Mmm. I WANT my Linux/FreeBSD ncurses+Windows CMD.EXE custom drawn labels, edit boxes, comboboxes, radiogroups and buttons ;)

(Yes, FreeVision/Novell Netware style programming ftw  :)

Well, why not create FreeVision visual runtime+designtime components for Lazarus? ;)

This might sound crazy at first, but it would be a doable project...
Regards, ArNy the Turbo Rascal
-
"The secret is to give them what they need, not what they want." - Scotty, STTNG:Relics

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11984
  • FPC developer.
Re: Custom Drawn Controls advances
« Reply #98 on: February 06, 2012, 08:32:13 pm »
The Java way. Portable to all systems, but native on none.  Maybe we can translate SWING :-)

You are exagerating, probably based on lack of knowledge. I assume you never actually tested LCL-CustomDrawn.

No, but I have reacted the same to msegui, fpgui (both iterations and fpgtk), and all others attempts. I've wasted enough time on them.

The problem is that not being native is not being rendered (and have the "feel") the way that  the user expects. That includes all parameterization based on systems settings.

Of course you can just say "you can emulate all that too, since the native lib also has to implement it", but then you are back at the same problem you balk at in the LCL. A need to go deep.

Quote
It does almost exactly the same as what Qt does,

... and on the *nix platforms Qt (or GTK) is what the users expect.

Quote
Qt is skinnable and imitates native widgets so good that you can't tell the difference.

Only for platforms they actually invested a crazy amount of work. If you really believe that this can work, why not simply use QT :-)

Quote
CustomDrawn is also skinnable and I already immitate pixel-by-pixel Windows 2000 controls. Lainz is doing a good job with a Windows 7 look and I already started the Android and Windows CE looks.

I've never seen a customdrawn UI that didn't fail within one minute of testing. Customdrawn has its place, and it is perfect for less popular targets, but for the tier 1 ports (OS X,Linux or Windows) it is IMHO not an option. I've some doubts on WinCE too.

Quote
If it looks exactly the same, pixel-by-pixel why do you say it isn't native?

It is not themable, the feel is not the same, it doesn't respect system font settings. the list goes on. It is only pixel by pixel the same in a simplistic case.

Quote
The native API also draws the same pixels on the screen. What difference does it make if the native API draws them or if the LCL draws them?

See above.

Quote
And to complete: I wonder if you also have the same oppinion of Qt? That it is the same as Swing?

Outside the core platforms (Linux, FreeBSD etc): yes.  I use pgadmin daily, and it isn't exactly close to a native windows app. The minute I can change it for something native I will.
« Last Edit: February 06, 2012, 08:50:17 pm by marcov »

Chronos

  • Full Member
  • ***
  • Posts: 249
    • PascalClassLibrary
Re: Custom Drawn Controls advances
« Reply #99 on: February 06, 2012, 09:21:48 pm »
In fact such custom draw controls and complete controls ecosystem should be base and entry point for implementing specific native components. Than CustomDraw could be called "native to Lazarus/FPC" or sort of. And all other platform specific widgetset should be implemented after as second phase as more suitable and "native to platform" solution but harder to maintain.
There is possibility to draw CustomDraw on HTML5 canvas in "native to LCL" way and after that implement "native to HTML" layer which would be specific better looking controls.

So custom drawn components are welcomed for fast migration to future platforms.

And custom draw widgetset can offer advanced controls which aren't present on other supported widgetset. FireMonkey show such possibility.

lainz

  • Guest
Re: Custom Drawn Controls advances
« Reply #100 on: February 13, 2012, 12:05:49 am »
I've updated the bgracontrols customdrawn_win7 drawer with the 'luna' theme (Windows XP theme).

luckily the windows xp msstyles had High DPI images so it was easy  ;D

You can download it with bgracontrols latest svn or git.
(I've not updated the bitmapthemeutils one because I'm lazy to know how to use the lazarus png graphics loading and manipulation. Feel free to 'port' the TBGRABitmapThemeUtil / TBitmapThemeUtil to the graphic library you want).

If someone want I've all the png of the three themes (luna, aero and aero lite), 1.68 MB 7zipped file.

TurboRascal

  • Hero Member
  • *****
  • Posts: 672
  • "Good sysadmin. Bad programmer."™
Re: Custom Drawn Controls advances
« Reply #101 on: February 13, 2012, 12:43:45 am »
Btw. what happens when the XP Luna theme is changed to MCE/Energy/Royale or Zune or Embedded?
Regards, ArNy the Turbo Rascal
-
"The secret is to give them what they need, not what they want." - Scotty, STTNG:Relics

lainz

  • Guest
Re: Custom Drawn Controls advances
« Reply #102 on: February 13, 2012, 01:13:02 am »
Btw. what happens when the XP Luna theme is changed to MCE/Energy/Royale or Zune or Embedded?

Also what happens when the Windows XP theme related dll are patched with uxpatcher and the user download and install between thousands of non-microsoft digitally signed user made themes?

You get the Custom Drawn XP Luna, wathever the theme is being used by the os in the controls supported by the drawer and those supported by custom drawn. Also you get XP Luna in Linux, MAC OSX and other compatible OS's (in this drawer, compatible with custom drawn and bgrabitmap).

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Custom Drawn Controls advances
« Reply #103 on: February 13, 2012, 09:17:08 am »
Answering to Marco:

I think you have no idea how much effort it is to write a new LCL widgetset. To write a new LCL-Cocoa interface because some asshole in Apple killed Carbon is aprox. 5 years of a lot of dedication, a huge lot of work. Do you know how much pain we went through migrating from Gtk to Gtk2??? Who here wants to spend the next 25 years of his life in wasted effort? Reimplementing the LCL again and again and again because some big shot executive has a new favorite "new way of reinventing the whell"? I don't. That's why I am writing LCL-CustomDrawn instead. But be my guest to send patches for LCL-Gtk3. Just don't tell me I didn't warn you when it becomes obsolete and your years of effort go down the toilet.

On top of that, have you ever seen our features list? It is *huge*. Every single control has tons and tons of features. And the native controls come very, very short of being able to implement our features. So then it starts the huge hack work of trying to hammer controls which were never written to implement LCL APIs into doing that. Seriously, why do you think that the native widgetset will have a list view which fits TListView? They don't have! Or have a buggy one. Apple is specially nasty here that they have a powerful list view for their own use but offer only a crippled one for 3rd parties to use. And you have no way to work around bugs in the native library. And then it starts the waste of time. It wastes my time when I have to reimplement the same features 5 times. It wastes my time when Apple kills Carbon and Microsoft kills WinCE. It wastes my time when I am working on a program, test it in Linux and it does not work perfectly out of the box in Mac due to widgetset differences. LCL-CustomDrawn will work perfectly. Implement all features perfectly. And work perfectly the same in all platforms. The look is irrelevant, you can change it to anything you want.

Why not use Qt? You know very well. The C++ connecting library is a serious problem and Qt is a huge library. Not to mention mobile platforms where you want to keep your size down. My Android APK is currently 1,6MB and it could be even smaller if FPC smartlinking worked better in libraries. And on top of that I have enough balls to eat my own dog food. LCL-CustomDrawn is implemented with the LCL. And that is very powerful, the ultimate test for my sub-window and drawing system is the fact that all controls are implemented on it, so they all test it extensively

Quote
Outside the core platforms (Linux, FreeBSD etc): yes.  I use pgadmin daily, and it isn't exactly close to a native windows app. The minute I can change it for something native I will.

I hope that you are aware that "Windows native" is obsolete. Microsoft changed it for Ribbons. Ops, but Ribbons are already obsolete too! They changed it for Metro. So how native will your native app be when Ribbons come to your desktop? How native will it be when Metro comes to your desktop?
« Last Edit: February 13, 2012, 10:51:37 am by felipemdc »

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Custom Drawn Controls advances
« Reply #104 on: February 13, 2012, 10:32:49 am »
Btw. what happens when the XP Luna theme is changed to MCE/Energy/Royale or Zune or Embedded?

Colors are respected if you are using a custom drawn drawer in its native environment, for example Win2000 drawer in any desktop Windows will respect the hi-contrast color choices and this is important for accessibility.

As for themes themselves they are completely banned from custom drawn because we have our own system for themes. And I don't know anyone which uses them anyway. And anyway those themes are futile and iTunes, Microsoft Media Player and tons of other software don't respect those themes anyway. In the long run we can add a themes configurator which can change all LCL apps in a given computer.

People that want controls which will follow the current Windows theme should stick with LCL-Win32. I never said that LCL-CustomDrawn will be the only widgetset available.
« Last Edit: February 13, 2012, 10:36:02 am by felipemdc »

 

TinyPortal © 2005-2018