Ripe for some re-factoring, a sample program

This is a program, where I slapped some ideas together from classes that I created over the years. The classes are of varying levels of completion, and different coding styles.

If nobody beats me to it, maybe I’ll spend some time to make the changes that are nagging at me, such as incorporating REGISTER() and overall cleanup, writing an actual function to call, etc. Copilot works pretty well for re-factoring, but it still takes time.

In the meantime, maybe someone can make use of it.

It uses a Clarion listbox for a Colorpicker, a Clarion ENTRY control for a hex digit scroller, and other weird stuff.

NOTE: It does require StringTheory

2 Likes

Looks interesting, Jeff.

I downloaded and tried to compile. Got three undefined colors. Did I miss an INC?

Unknown identifier: COLOR:SAND - C:\cproj11\misc\Jeff\ColorTools-master\JSPaletteClass.clw:167,17
Unknown identifier: COLOR:LIGHTSAND - C:\cproj11\misc\Jeff\ColorTools-master\JSPaletteClass.clw:168,17
Unknown identifier: COLOR:LIGHTGRAY - C:\cproj11\misc\Jeff\ColorTools-master\JSPaletteClass.clw:169,17

Commented them out to compile. Thanks for sharing.

1 Like

Thanks for letting me know Jane

Hi Jane -

I see those equates in C11 and 11.1, but not my C10 equates. Are you compiling pre-C11?

Thanks.

Hi, Jeff,

I’m still on 11.0.13401.

This is what’s in equates.clw.

I can see that I need to adapt this example to be compatible with at least C10.

Many of the equates in use in the classes are not available in C10, such as SkyBlue.

Thanks for bringing that to my attention. I had no idea how luxurious C11.1 was :slight_smile:

In 11.0.13505 after COLOR:SkyBlue I see those colors:

COLOR:Sand                    EQUATE (00DEEBEFH)
COLOR:LightSand               EQUATE (00D8E9ECH)
COLOR:LightGray               EQUATE (00E0E0E0H)

So obviously just change that code to use the hex value instead of the equate.

1 Like

Obviously, Carl :wink:
Thanks for the equates.

Glad you’re luxuriating, Jeff!
My canary-in-the-coal-mine was Robert Paresi, and when he said a new version was stable I upgraded.
Since he’s retired I find something that works and stick with it. Not interested in AnyScreen, and haven’t had problems with the version of 11.0 I’m using, so I’ll wait for the 64-bit Clarion-2024 to upgrade :wink:

1 Like

I added compile switches for all of the colors that aren’t available in my copy of C10. The switch is for C11.1 because the versions of C11 aren’t consistent.
And I didn’t think it would be prudent to take it upon myself to give out these free equates :slight_smile:

I’d just use the color hex codes. Those are not the Windows Standard 16 colors. SV got them from a some list of colors, like maybe web colors .

They are some System Colors worth adding. Microsoft added then in NT 4 in 1996, but SV didn’t add until C11. This tool also makes System Colors easier to understand:

1 Like

Will add that to the list of things that need improved. Thanks for the suggestions Carl.

I think something like this will work if you don’t have the exact Clarion version:

  COMPILE('**newcolors**',COLOR:RoyalBlue)
    SELF.AddColor(COLOR:RoyalBlue ,'COLOR:RoyalBlue'  ,, FALSE )
    SELF.AddColor(COLOR:SteelBlue ,'COLOR:SteelBlue'  ,, FALSE )
    SELF.AddColor(COLOR:SkyBlue   ,'COLOR:SkyBlue'    ,, FALSE )
    SELF.AddColor(COLOR:Sand      ,'COLOR:Sand'       ,, FALSE )
    SELF.AddColor(COLOR:LightSand ,'COLOR:LightSand'  ,, FALSE )
    SELF.AddColor(COLOR:LightGray ,'COLOR:LightGray'  ,, FALSE )
    SELF.AddColor(COLOR:Fuschia   ,'COLOR:Fuschia'    ,, FALSE )
  !**newcolors**

Interesting idea, Carlos. Thanks. But Jane has that equate. She doesn’t have those other 3. So I punted :slight_smile:

  COMPILE('**C11.1**',_C111_)
    c.AddQRecord('3DDkShadow'              , COLOR:3DDkShadow              )
    c.AddQRecord('3DLight'                 , COLOR:3DLight                 )
    c.AddQRecord('InfoText'                , COLOR:InfoText                )
    c.AddQRecord('InfoBackground'          , COLOR:InfoBackground          )
...
  !**C11.1**

Those System Colors were defined in 11.0 so can COMPILE('**C11.0**',_C110_)

Or probably better only add if defined. They can be defined in any Clarion and work.

  COMPILE('**NT4 SysColor**', COLOR:3DDkShadow)
    c.AddQRecord('3DDkShadow'              , COLOR:3DDkShadow              )
1 Like