![]() |
|
Published 1999-01-01 Printer-friendly version
How can I change the background color in the Embeditor? The black on gray is making me go blind.
You could stop using the Embeditor when you need glasses, or you can change the Embeditor's color options. You can do this in one of two ways--through the IDE or by editing the editor's INI file. Editing the INI file allows you to choose more colors, but the colors available from the IDE's color choice dialog should be enough.
To change the color from the IDE:
To change the color by editing the INI file:
When you restart Clarion the editor uses the color you specified.
I want to add an animated GIF to my application's toolbar that works like NetScape's or Internet Explorer's. I want the image to move when a process is working and stop when there is no activity. Does an IMAGE control have a property I can set to make it stop?
Nope, but they aren't setting a property to stop the animation in the programs you've seen either. If it were to merely stop animation at the time activity ceases, you would see the animation freeze at a random position. In other words, you would see it frozen at different frames within the animation sequence. What they are doing behind the scenes is changing the image's source.
Here is an example:
If ActivityHapening !Flag
?Image1{Prop:Text} = '~spinning.gif'
ELSE
?Image1{Prop:Text} = '~stopspin.gif'
END
Now since you want this on the application's frame, you will need to setup some user-defined events and set the IMAGE's graphic based on these events. The procedures that you want to be able to change this image will post the appropriate events to the frame at appropriate times.
Let's walk through the steps:
First, you have to set up a means of communicating with the frame procedure from the child procedure. This involves three parts:
Next, define a global variable (Press the Global Properties button, then press the Data button). Call this GLO:MainThreadNo and make it a BYTE.

Next, declare two new event EQUATEs in the Global Properties, Global Data embed point:
EVENT:StartActivity EQUATE(401h) EVENT:StopActivity EQUATE(402h)
(Note: user-defined events must start after 400h.)
Next in the Frame procedure, find the Local Objects, ThisWindow (WindowManager), Init procedure, CODE, Initialize the procedure embed point [Priority 6,001]. Insert the following code:
GLO:MainThreadNo = THREAD()
This stores the frame's thread number in the global variable. Whenever an MDI procedure is STARTed, a thread number is allocated to it. We need the thread number in order to post a message to the frame procedure.

Now, still in the frame procedure, find the Local Objects, ThisWindow (WindowManager), TakeWindowEvent procedure, CODE, CASE EVENT() embed point [Priority 7,550]. Insert the code to handle the two user-defined events that the frame procedure will receive. This embed point places the code inside the CASE structure which handles events.
OF EVENT: StartActivity
?Image1{Prop:Text} = '~spinning.gif'
OF EVENT: StopActivity
?Image1{Prop:Text} = '~stopspin.gif'
Now to start or stop the animation from another procedure, embed the following code at the point where you want to control the animation (e.g., the Window events--OpenWindow and CloseWindow):
POST(EVENT:StartActivity,,GLO:MainThreadNo)
or
POST(EVENT:StopActivity,,GLO:MainThreadNo)
Note that the second parameter is omitted ("comma comma").
That's all there is to it. Now your application will provide the feedback your users want.
I. am using "latched" radio buttons (RADIO button controls with an ICON specified). This shows one depressed at any one time. Pressing another, raises the one formerly depressed. I want to be able "clear" them all so none appear depressed. Can you help?
My RADIO buttons have occasionally suffered from depression, too. And Prozac does not help.
What I did was consult my favorite medical reference--The Language Reference! This contains the prescription we need to raise those buttons. Quoting from the LR:
"No RADIO button selected is a valid option, which occurs only when the OPTION structure's USE variable does not contain a value related to one of its component RADIO controls. This condition only lasts until the user has selected one of the RADIOs."
In other words, if the OPTION's USE variable is set to a value that is not a value of a RADIO choice, then all RADIO buttons appear raised. You set this value at the appropriate point in the code where you want to "reset" the buttons.
Copyright © 1999-2009 by CoveComm Inc. All Rights Reserved. Reproduction in any form without the express written consent of CoveComm Inc., except as described in the subscription agreement, is prohibited.
Clarion Magazine ISSN 1718-9942
One year: $169
(includes all back issues since '99)
Renewals from $119
Two years: $269
Renewals from $219