Free Controls: Switch/Color Selector/Font Selector


Dropbox Download

Just thought i should share 3 of my controls. This forum is so helpful, time to give something back.

  1. Switch (Horizontal/Vertical) Canvas Custom Control; Not using any picture, real-time drawn.
  2. Color Selector (2 own Palette (Theme and 48) and SelectColor integration) Canvas Custom Control; Using one icon/picture for the ‘More color’ section, real-time drawn.
  3. Font Selector (Optional Preview of the Fonttype) Based on PopupMenu.

You can use it for free, just name ‘cmd IT-Services’ somewhere in the credits.

My benefit should be feedback and bug reports, that’s why i keep the source encrypted.

Hope this is useful for some of you.

Switch and Color Picker are Retina ready (Text) and can be used in any size as they are 100% drawn without any picture, the example code enables Retina for OS X.

Sweet. Thanks for sharing :slight_smile:
Are you sure the switch is retina ready though? :wink:

[quote=184413:@Albin Kiland]Sweet. Thanks for sharing :slight_smile:
Are you sure the switch is retina ready though? :wink:

[/quote]
The Text is, as all the controls don’t use any OS specific declares, the painting is done with pure XOJO functions.
This means for the moment, that only the Text can be drawn in Retina resolution, the other drawing and picture functions have to wait for the XOJO update …

Of course, you can do your drawing in Retina. This isn’t really that complicated.

And it’s a pity that your controls are encrypted. Otherwise, I could add the Retina code myself.

I didn’t found a way without temporary storing the created image as a file with proper naming for retina, as i don’t want temp files i decided not todo so. Happy to hear about other approaches and also happy to add any idea with credit notes.

Just updated the downloadfile and enabled the, Scalefactor for the switch, this should help with Retina displays

MUCH better! Great job! :slight_smile:

yes sorry, forgot to enable the scaling in the first upload, pitty this dosn’t work/help for text on picture objects … let me know when you find bugs/wrong behavior, thx

[quote=184418:@Beatrix Willius]Of course, you can do your drawing in Retina. This isn’t really that complicated.

And it’s a pity that your controls are encrypted. Otherwise, I could add the Retina code myself.[/quote]

guess the new version enabled what you was looking to add

Uploaded new Version, changes:

  1. Switch: Property TextFont was ignored, corrected
  2. ColorSelector: New Properties added, updated Example Window1, Control updated to new DrawingEngine

Looks nice on OSX. However the are some problems on Windows. On my windows PC, it takes about 8 seconds to load the demo form and the graphics seem to be a bit screwed up (like the white background in each control).

[quote=184648:@Alain Bailleul]Looks nice on OSX. However the are some problems on Windows. On my windows PC, it takes about 8 seconds to load the demo form and the graphics seem to be a bit screwed up (like the white background in each control).
[/quote]
Alain,

which Win Version and which XOJO Version are you using? GDI+ is on?

Same here.
Xojo 2015 r2.1
Windows 7

Windows 7 x64
Xojo 2013 r4
Same output as Peter and Alain…

Same here.
Xojo 2015r1
XP
GDI Plus is on

Thank you all for your Feedback, uploaded a new version, as i don’t have Win available (OS X and Linux only) i would appreciate if you guys can download the new version and check. I found a bug and hopefully all reason’s for the ‘screwed up’ look. Thanks in advance for your help.

Btw, the Font Selector need’s to be moved from Superclass PopupMenu to a Canvas based like the Color Selector, i need it now on Linux as well and the PopupMenu doesn’t support what i need. In the meanwhile i had to switch to a BevelButton as a carrier.

Uploaded new Version, tested on OS X and Linux.

Changes:

  1. Switch: Changed graphical symbols & color optimization
  2. ColorSelector: Allows Focus & FocusRing, any KeyDown opens ColorPickerWindow
  3. FontSelector: Changed to Superclass cmdPopupMenu which is a Canvas based control with PopupWindow as DropdownList

Added:

  1. cmdPopupMenu: Same look on all OS; using cmdPopupWindow as selection list, uses internally MenuItem Objects
  2. cmdPopupWindow: Generic replacement for any style of popup lists (Doesn’t support child menu items and only pop’s down vertical)

Will upload tonight a new version, as you can see in the upper most screenshot i got the chance to have a win box for a day to tweak the graphics. Was a huge surprise for me how big the differences are. Still no declares but some Target conditions. Big learning: GDI+ integration is very bad, had to switch it off most of the times. Wonder if the integration is correct if you need to tweak on pixel level.

Without a box for each OS it’s nearly impossible, wonder what your experience is…

New Version uploaded to Dropbox.

Changes:

  1. Win32 GUI Tweak
  2. Extended Properties for cmdPopupMenu, Background, ArrowColor etc.

Bugs solved:

  1. cmdPopupWindow, if Mouse leaves Top/Bottom Arrow Area the infinite scroll didn’t stop