I am trying to use EQUATES in all my WIndow Declaration to get all FONT related settings the same but I am getting below error after setting the size - typeface works:
!!> ERROR(82): Value of parameter has incorrect type
I used Global Variables with an initial value and not equates, this way, I can still alter the font settings for different users with different monitors, when required without having to recompile the program and produce a one off program for the user in question.
I’m surprised that you can use equates in the screen structures. Perhaps they would compile, but the screen designer wouldn’t allow that.
Instead of doing that, I would more likely use a class and template to assign them at runtime when the window is first opened.
If you go that route, note that making too many changes to the window structure between the OPEN and ACCEPT statements can cause instability. To deal with that, I will typically hide the window after it’s opened, then wait for EVENT:OpenWindow. I apply all of the changes at that point, then unhide the window.
You see Equates often in screens like FONT(,,Color:Black, Font:Bold, CharSet:Default)
The problem is getting them in scope for the IDE to know about them. Maybe if they were in Equates.clw. So have an Equates.clw in your project folder with your extra equates plus Include the file from LibSrc so your have the standard ones. I doubt it will work but it’s worth a try.
The C7 Designer will allow equates or variables for a lot of things it does not need to render in the designer. Like you can have FROM( CreditCardCodesEquate ). You run into a problem with the Window Previewer unless you add your equates to a WindowPreviewer.INC in your project folder.
I also have my own window which has the controls to set all of the above, and it also includes a Lineheight var & spin control to set ?L1{PROP:LineHeight} = 8 for all list boxes. This way the user can spin up or down and see a list box populated with text adjust in realtime.
You say you are declaring them “inside Global Map” That doesn’t sound right. Define them in the Global Data embed section. I would not use equates, but rather global variables - makes it a lot easer to change
The problem is getting these Font settings in “IDE Scope” so the Designer understands them. The way it understands equates FONT:Bold = 700 and COLOR:Red = 255 and renders that.
I don’t know how to do that. I wonder if those values are in the .Net code. You see oddities like Clarion Color BtnFace is ButtonFace in Designer. It works but it must be mapping between the two enumerations.
I found Clarion was missing 8 equates added in Windows NT 4 and 95. They were added by SV in Clarion 11.
In C9 I added them to LibSrc \ Equates.Clw. I don’t recall exactly how they worked in Designer but I’m sure it was not like all the other colors. I think it translated them into RGB colors and left them that way, so I lost the “System Color” feature. E.g. Color :HotLight changed to :Blue.
As I noted above I think the first thing to try is adding the Font equates to Equates.clw and see how it works in Designer.