The Dogwaffle Style
Dogwaffle Specific Controls
Dogwaffle has a handful of custom controls that make up the unique interface. They are:
• Bevel box
• Button gadget
• Horizontal prop gadget
• Mutually exclusive button gadget
They are typical OCX controls that can be added to your project in Visual Basic with the Project/components menu item. Once added, they can be added to your form just like regular controls.
Bevel box lets you create a bounding box with several styles like raised, recessed, or both.
Button gadgets acts like a typical button control. Setting the Button_type property to 1 causes it to act like a toggle instead of a button. The toggle state can be read with the Value property.
Prop gadgets are horizontal sliders. You can set the min, max, and value parameters just like a slider or scrollbar.
Mutually exclusive buttons act like regular toggle buttons, except when you select one, all other mx_buttons on a form are de-selected.
When working with the barebones project, there are several tags you can set to control the look of these controls, based on user settings. The barebones project contains a function called PrefsCallback that is called when a form is loaded. If you add a form, you should consider adding a call to PrefsCallback in the forms load event.
Adding one of 3 strings to a controls Tag property will give a different shading than the regular button ‘backfill’ color. They are "Setting", "Action", and "Tool".
It is possible to read all of Project Dogwaffle’s visual style settings from the registry. Preset values are given, in case a user has never saved any preferences.
Dim MYBackColor As Long
Dim MyTextBackColor As Long, MyTextForeColor As Long
Dim MyComboBackColor As Long, MyComboForeColor As Long
Dim MyShineColor As Long, MyShadowColor As Long
Dim MyHalfShineColor As Long, MyHalfShadowColor As Long
Dim MyButtonFillColor As Long, MyScrollFillColor As Long
Dim MyScrollbarColor As Long
Dim MySpecialBackdropColor As Long
Dim MySpecialSettingColor As Long, MySpecialActionColor As Long
Dim MySpecialToolColor As Long
Dim MyBorderlessButtons As Long
Dim MyBorderlessScrollers As Long
Dim MyBorderlessStrings As Long
Dim MyBorderlessTabs As Long
Dim MyTabHilightColor As Long
Dim MyRulerColor As Long
Dim MyTextboxFillColor As Long
Dim MyTextboxTextColor As Long
Dim MyApp As String, MySection As String
MyApp = "dogwaffle": MySection = "Startup"
' interface colors
MYBackColor = &H9E958F
MyShineColor = GetSetting(MyApp, MySection, "Shine_Color", &HE0E0E0)
MyShadowColor = GetSetting(MyApp, MySection, "Shadow_Color", &H202020)
MyHalfShineColor = GetSetting(MyApp, MySection, "Half_Shine_Color", &HC0C0C0)
MyHalfShadowColor = GetSetting(MyApp, MySection, "Half_Shadow_Color", &H707070)
MyButtonFillColor = GetSetting(MyApp, MySection, "Button_Fill_Color", &HC0C0C0)
MyScrollFillColor = GetSetting(MyApp, MySection, "Scroll_Fill_Color", &H9E958F)
MyScrollbarColor = GetSetting(MyApp, MySection, "Scroll_Bar_Color", &HFFFFFF)
MyTabHilightColor = GetSetting(MyApp, MySection, "Tab_Highlight_Color", &HD0F4FF)
MyRulerColor = GetSetting(MyApp, MySection, "Ruler_Color", &HB8E8FA)
MyTextboxFillColor = GetSetting(MyApp, MySection, "Textbox_Fill_Color", &H665555)
MyTextboxTextColor = GetSetting(MyApp, MySection, "Textbox_Text_Color", &H88EEFF)
MySpecialBackdropColor = GetSetting(MyApp, MySection, "Special_Backdrop_Color", &H9E958F)
MySpecialToolColor = GetSetting(MyApp, MySection, "Special_Tool_Color", &HC1BEC9)
MySpecialSettingColor = GetSetting(MyApp, MySection, "Special_Setting_Color", &HC5C5B6)
MySpecialActionColor = GetSetting(MyApp, MySection, "Special_Action_Color", &HB5BFBD)
MyBorderlessButtons = GetSetting(MyApp, MySection, "Borderless_Buttons", 0)
MyBorderlessScrollers = GetSetting(MyApp, MySection, "Borderless_Scrollers", 0)
MyBorderlessStrings = GetSetting(MyApp, MySection, "Borderless_Strings", 0)
MyBorderlessTabs = GetSetting(MyApp, MySection, "Borderless_Tabs", 0)
MyTextBackColor = MyTextboxFillColor
MyTextForeColor = MyTextboxTextColor
MyComboBackColor = MyTextboxFillColor
MyComboForeColor = MyTextboxTextColor
It is also possible to get the image of the current ‘wallpaper’ texture used in forms.
For example, you could use this routine on startup to read the pattern into an image control.
On Error GoTo done
Wallpaper = Dogwaffle.Dog_WallpaperFilename
Image1.Picture = LoadPicture(Wallpaper)
On Error GoTo 0
And you could use this subroutine to display it on a form. Make sure you have an image control on the form, and the forms scale mode is set to pixel.
Public Sub Draw_Pattern(ByRef ThisObject)
'draws dogwaffles tiled pattern into a form or picturebox
Dim X As Long, Y As Long
Dim pw As Long, ph As Long
Dim dw As Long, dh As Long
On Error GoTo Skip
'if use patter then...
pw = Image1.Width
ph = Image1.Height
dw = ThisObject.ScaleWidth
dh = ThisObject.ScaleHeight
For Y = 0 To (dh) Step ph
For X = 0 To (dw) Step pw
If ThisObject.Visible = True Then
ThisObject.PaintPicture Image1.Picture, X, Y
On Error GoTo 0