Copyright (c) 2014 John Doe
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Preface
Purpose of this Software is to create a skinned form to be used on Windows Forms Projects. All Software in written in C#, only a couple of samples are written in VB. In fact it is possible to use classes and dll created with this Software in both programming languages. All Software in written using SharpDevelop IDE on Net Framework 4.0.
The solution include six project:
1. JdFormsDll - is the Dll that’s ‘Decore’ the standard windows form
2. JdForms - is the program that’s create C# class, Vb class and Dll with the Decorator files
3. JdFormsCsharpClass - is the sample that’s use C# custom class
4. JdFormsCsharpDll - is the sample written in C# that’s use custom Dll
5. JdFormsVbClass - is the sample that’s use Vb custom class
6. JdFormsVbDll - is the sample written in Vb that’s use custom Dll
Please note that’s this is an ALPHA Release and many parts have to be developed.
JdFormsDll
This is the main class used for to decorate the standard windows form. It’s create a derived form from a standard System.Windows.Forms.Form. It is based on a borderless form and create a decorated custom form. This Software do not use any image, you can only create custom colors, control boxes are draw with standard window fonts.
At the moment only MyFormMessageBox, MyFormToolStrip, MyFormStatusStrip and MyFormButtons are also decorate.
This Dll include also a decorator class MyFormDecorator for to create and load decorator files.
Hidden Properties
Padding - create a custom borders
FormBorderStyle - create a custom border style
DoubleBuffered - for drawing
Replaced Properties
Text - Caption Text
Icon - Caption Icon
ShowIcon - Show / Hide Icon
MaximizeBox - Show / Hide MaximizeBox
MinimizeBox - Show / Hide MinimizeBox
ControlBox - Show / Hide ControlBox
BackColor - Caption and Client Area Color
Custom Properties
BackColorShadow - Caption and Client Area Color Shadow
IsResizable - I can resize the form
BorderColor - Window Color
TextCaptionColor - Caption Color
TextCaptionColorShadow - Caption Shadow Color
TextCaptionShadow - Caption Text Shadow
TextCaptionAlignment -Caption Text Alignment
TextCaptionFont - Caption Text Font
BorderStyle - Form Border Style
CaptionBorderRoundPercent - Caption Rounded Corner Percent
ColorsDifferencePercent - Difference Percent between BackColor and BackColorShadow
ShowClientBorder - Show / Hide Client Area Border
ShowCaptionBorder - Show / Hide Caption Area Border
IsMoveable - I can move the form
ShowTooltip - Show / Hide form Tooltips
MyFormDecorator
When you create a class you have to pass MyForm and a path where you want to save your decorator files (repository), don’t care if the path do not exists because it is create automatically. This class create a main directory JdForms.Configurations with four different directories inside:
1. Decorator - used for to store decorator files
2. CSharp - used for to store C# classes
3. Vb - used for to store Vb classes
4. Dll - used for to store Dll assemblies
If you do not pass a directory name, main directory shall be create in <%AppData%>
When you pass the MyForm all the initial form settings shall be stored in this class.
Methods
RestoreProperties - restore initial properties
OpenDecoratorFolder - open decorator folder
OpenDllFolder - open dll folder
OpenCsharpFolder - open C# folder
OpenVbFolder - open Vb folder
GetFiles - get all’s decorator files saved on Decorator folder
Load - load a decorator file from the path passed
Open - open OpenFileDialog for to load a existing decorator file
Save - open SaveFileDialog for to save current MyForm decorator settings
CopyTo - copy current decorator to the MyForm passed
ShowDialog - open a MyFormEditor form for to edit decorator settings at runtime
It’s use the above functions but include also a C# class and Vb class generator plus a C# compilator in order to create standalone Dlls. In this project you can see how decorator is working, MyFormMessageBox, MyFormToolStrip, MyFormStatusStrip.
On ‘Internal’ tab you can use all’s the functions shown in MyformDecorator while in ‘External’ you can use all’s the functions included in this project (‘Create C# Class’, ‘Create Vb Class’, ‘Create Dll’).
The main form show all the decorator files saved on repository, you can select which file you want include in your class/dll and then you can create class or dll. Each class or dll shall be saved on relevant directory as explained above.
The other four project are a simple demonstration for the use of classes and dll in both C# and Vb project.
This Alpha Release DO NOT INCLUDE any comment that’s shall be included later.