October 29, 2025, 12:48:26 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Custom Font and Color Selection Demo

Started by LarryMc, October 22, 2009, 12:00:21 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

LarryMc

Attached is something I had been working on but I've had something else come up that I need to spend more time on.

So, I'm posting all my code and supporting files for anyone to learn from if they are interested.
I wouldn't have gotten as far as I did without Sapero's help.

The basics:
I used the "hooks" into the MS standard font and color dialogs to substitute my own custom dialogs.
My dialogs do all that the standard dialogs do but more.
My font dialog:
QuoteRemembers where it was on the screen the last time it was opened.
Let's you enter a window and control ID for use in generating Ebasic commands
Remembers those ids between sessions and between the font and color dialogs.
Provides a button that generates a complete SETFONT command based upon your current selections.
Provides a button to allow you to call the color dialog from the font dialog.
My color dialog:
QuoteRemembers where it was on the screen the last time it was opened.
Let's you enter a window and control ID for use in generating Ebasic commands
Remembers those ids between sessions and between the font and color dialogs.
Provides a button that generates a complete SETWINDOWCOLOR command based upon your current selections.
Provides a button that generates a complete SETCONTROLCOLOR command based upon your current selections.
Provides a button that generates a complete  RGB command based upon your current selections.
Provides a button that generates a string in the 0xFFFFFF based upon your current selections.
Shows sample text in the currently selected font (at a fixed size) that updates in realtime as selections are change.
Provides radiobutton to select whether you are viewing/setting foreground color or background color.
Remembers all settings between sessions.
Provides buttons for loading/saving 16 color palettes into the 16 custom color boxes.
Provides an eyedropper that can be used to select the color from anywhere on your screen by dragging it.
Has a window that magnifies the area around the eyedropper tip when it is being dragged.
Foreground/background color is changed realtime when eyedropper is dragged

Both dialogs:
QuoteAll generated strings are placed on the clipboard so you can paste them into you program.
Use context sensitive help '?' on all labels and controls.

I never intended for anyone else to see the code so there aren't many comments.
If you start playing with it and have questions I will do my best to answer.

I included an exe file so you can play with the end result before you try to compile it.

I only ask that if someone makes something really neat out of it that I get a copy.

Warning: if you start changing the code be careful because it is real easy to break the code in places.

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Haim

October 22, 2009, 01:22:55 AM #1 Last Edit: October 22, 2009, 01:43:23 AM by Haim
Very interesting.
A lot of good stuff to study there.
Thanks for sharing, and keep them coming  :)

Haim

NB
I tried to build the project but I get thefollowing responses:

Compiling Resources...
Error!
Line 11 of Resource Script (C:\dl\EBASIC\IDE_FC\IDE_FC.RC):-
Unexpected word:-
,

RES file not made
Error compiling resources

Any idea?
Haim

LarryMc

LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Haim

Thanks,
forgot about it.
I updated gorc. it now builds perfectly.

Time to study your code now.

Haim

fasecero