Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Downloads
Search: 

Changing Colors and Styles of controls at run-time
Greg Reichert, GLR Software
This object, when dropped on a form, automatically sets the colors and other properties of all the controls on the form to those that match the same properties on the Style object. Set the properties value once on the Style control, and when the form is ran, then all the controls with the same property have the same value. The only exception are those control that have set the same property explicitly. Works in VFP 6.0 and greater. Version 1.00 has been enhanced with more properties and a Style.txt file for global settings.
Created on
20 years ago
Downloads
1571
File type
Freeware
General information
Description
--------------------------------------------- Introduction --------------------------------------------- Even with global base class to aid in generalizing the look and feel of the application, it can sometimes be difficult to assign the same BackColor to all relative controls. Not to mention, if the user wish to be able to change the look of the application on their machine only. This is a issue that arose resendly to me. So I created the Style object. Now in one place I can control the general look of all of the controls on form or in an application with other dirting up the base classes. --------------------------------------------- Running the Demo. --------------------------------------------- The demonstration form ("Test.scx") illistrates how the Style class applies its own properties to the Form and Controls during run-time. To get the full extent of the demo, open the Test.scx form in the Form Designer. Notice that the colors are the default gray tones. Now run the form. The form and controls now have a Brown tone (Earth tones). Click the radio button with the caption "Shy and Sea", and the colors change to Blue tones. The same for "Valentines Days" button, the colors change to Red tones. But because the ForeColors of the caption of the Radio Buttons are set explicitly at the control level, the Style control does not change that property. --------------------------------------------- Instruction on using the class --------------------------------------------- The Style object is placed anywhere on the form at design-time or can be added with an AddObject method at run-time. More then one Style can exists at a time, providing they have different referencing names. For large applications, the developer may elect to initaniate a global reference to the Style objects and reference then from the Form from there. Once a means of referencing the Style object has been established, the developer must set the properties of the Style class. This can be done either at Design-time (as in the Demo), or applied at run-time, as from a Style file (future version, maybe). As in the demo form, place the statement "ThisForm.Style1.Update()" in the Show method. Now when the Form displayed, then Style1 properties are applied to the form and its controls. Set the lStyleFile property to true (.T.) will inform the Style object to locate and load the Style.Txt file. This file contains properties and values that will override the design-time settings at run-time. This file is good when multiple Style object are available, and certain properties must be a specific value all the time. ----------------------------- Style.txt format ----------------------------- The Style.txt file is a Text file, located at one the following folders. * On the defined Path. * Current folder. * Root of the C Drive (C:\) * or in the C:\Documents and Settings\\My Documents\ The format and syntax of the file is a name / value pair configuration. Only lines that are not blank or start with a astrick (*) are evaluated. The first word of the line is the name of the property, followed by a equal sign (=), then the value for the property. e.i. ForeColor = rgb( 0,0,0 ) --------------------------------------------- Properties and Methods. --------------------------------------------- ----------- Properties ----------- Most of the Standard Methods, Events, some of the Properties have been assigned as Hidden to prevent the unnessacary assignments. The User can alter the Property list by adding or hiding property that match properties on other controls. lStyleFile boolean .T. (default) Load Style.txt file and assign its values to the properties. .F. Do not load Style.txt cStyleFileName String blank (default) The name and path to the Style.txt. Assigned when the Style class is instaniated. ----------- Methods ----------- Update( [toObj] ) : Called to apply the property settings. The toObj parameter is the parent control that the properties will be applied. Defaults to THISFORM. --------------------------------------------- ----------- WARNING ------------ --------------------------------------------- 1. This has not been tested with FormSets or ActiveX controls.
Created by
Greg Reichert, GLR Software

Comments
if the word NoStyle is in the Tag property of an object the style is not applied. Contributed by Koen Piller piller@quicknet.nl - June 17, 2009 - thanks. Greg Reichert, June 18, 2009

I understand, to some degree, why you are hiding properties, although your list seems incomplete. But why are you also hiding methods? That shouldn't be necessary, should it? James R. Nelson, June 20, 2009

More downloads created from this member
Greg Reichert, GLR Software
Image be able to manage an array (or any list of data) using a SQL statements. Well with this little tool you can. Query allows you to select, update, delete, and even insert data into array, collection, cursors, file directories, most any list of data. And it can be extended too. Yes; you can cr...
Created on
17 years ago
Downloads
2193
File type
Freeware
Rating
5.00/5.00
Greg Reichert, GLR Software
I would like to indroduce a new utility from the on going series of LifeCycle. FUnit is a NUnit like utility for unit testing and coverage analysis for object orientated applications. You write you test cases in the method that will be tested. Then run the FUnit utility. It will scan the application...
Created on
17 years ago
Downloads
539
File type
Freeware
Rating
5.00/5.00
Greg Reichert, GLR Software
Automatally closes a form after N seconds of inactivity from the user. Based on Timer class and monitors the current position of the cursor and mouse. Just drop the control on any form, and set the desired duration of the delay.
Created on
18 years ago
Downloads
2154
File type
Freeware
Greg Reichert, GLR Software
The purpose of LifeCycle - Build Phase utility is to provide a central application to automated as much of the built process as possible without have to clone code, or replicate the procedure for different projects. It also provides the means to schedule automated builds for daily builds. The util...
Created on
18 years ago
Downloads
599
File type
Freeware
Greg Reichert, GLR Software
AuthCode, or Authentication Code, is an add-on form that makes the application into an evaluation copy type. The user can use the application until either an expiration date or count runs out, or they have registered it by entering an authentication code. At which time the application will stop aski...
Created on
19 years ago
Downloads
2562
File type
Freeware
Rating
4.00/5.00
Greg Reichert, GLR Software
This object encapsulates the SYS() and SET() functions in methods of a class. This allows the developer to use these function by named instead of sum number. Plus it provides more readability of the source code. 12/15/2005: Included classes the encapsulate the SysMetric(), FontMetric(), Home(), and ...
Created on
19 years ago
Downloads
894
File type
Freeware
Greg Reichert, GLR Software
This tiny control resizes controls on forms. Just drop this control on any form. Set the TAG properties of the controls you wish to resize to a combination of T,L,H,W. And place a Thisform.Refresh() statement in the form's Resize event. That is all there is to it. Now work properly in VFP 6.0.
Created on
19 years ago
Downloads
2506
File type
Freeware
Greg Reichert, GLR Software
Multiple Project Hooks is a ProjectHook class that allow for chaining more then one projecthook class per project manager. If you have different projecthook class that do different tasks, and you want then all to be a part of the current project you are working on, you normally would have to combin...
Created on
19 years ago
Downloads
627
File type
Freeware
Greg Reichert, GLR Software
This routine uses Google's spelling correction feature of their search engine to perform spell checking. When a mis-spelled word is submitted, Google attempts to correct the spelling and persents it as a phrase near the top of their result page. The corrected phrase is always after the term "Did y...
Created on
20 years ago
Downloads
671
File type
Greg Reichert, GLR Software
The purpose of this application is insure that the local copy of the application, and it dependent files, are always up to date. The remote copies of the application can be located either on LAN/WAN server, HTTP web server, a FTP site, or even a Email attachment. In addition, the AppStart can instal...
Created on
20 years ago
Downloads
2424
File type
Greg Reichert, GLR Software
This control is a simple treeview using the WebBrowser control and a HTML file to drive a VFP form. The tree itself is a standard html outline using the "UL"/"LI" tags. What make this the simplest, is that the only one OnClick event is established, and that is at the first (or root) "UL" tag.
Created on
20 years ago
Downloads
3005
File type
Rating
5.00/5.00
Greg Reichert, GLR Software
The Locale class automatically translates captions, tooltips, and statusbar text from one language to an alternate language with the use of the internet, then stores the translation for future use and faster translations. Now with 8 languages and uses 11 web-sites for the best and fastest possible t...
Created on
20 years ago
Downloads
2236
File type
Greg Reichert, GLR Software
Monitor and remotely terminate running application from across the network. Great for those times you need to force users out of applications they have left running. Also, the administrator can check for dead applications or those that are reporting they are in a critical section of the program, lik...
Created on
20 years ago
Downloads
4146
File type
Freeware
Greg Reichert, GLR Software
Have your clients ever ask to have their forms remember their position and size? This neat little control does just that. Now works with VFP 9.0 Anchors. Just drop it on any form, and it will remember its position and shape. The properties are saved in the registry for each user that can log on ...
Created on
21 years ago
Downloads
2088
File type
Freeware
Greg Reichert, GLR Software
Link update only. Have you ever needed a Mover control, but space is limited. This control provides many of the same features as the Mover control, but all in the same space of a single listbox. There are several different demos of this in the download. Also, a couple of the demos use a slider con...
Created on
21 years ago
Downloads
1973
File type
Rating
5.00/5.00
Greg Reichert, GLR Software
Link adjustment only. Auto hide any form behind the VFP desktop, pop it back out when the mouse is hovering over it. The AutoHide class can be dropped on any form to provide the ability for the form auto hide itself behind the VFP border. This is similar to other autohide feature found in windows d...
Created on
21 years ago
Downloads
2244
File type