Creating Skins with SkinSys Ver 1.0

Introduction

SkinsSys is a picture-based skin system written in Visual C++/MFC and based on FriendSoft's SkinForm.

Contents

This article (and its downloads) includes the following:
  • CSkinsys codes
  • Simple Skin Editor
  • A beatiful MPEG 1,2,3 decoder (Copyright www.eldos.org - based on the MAPlay Decoder)
  • MPEGPlayer project

Download Directories

Once you download and extract the files, you'll see several new folders. Here is what each is used for.
  • Decoder: MPEG Decoder codes
  • Editor : Skineditor Files
  • Sample : Sample Skin Files
  • SkinSys: CSkinsys Codes
  • Root : MPEGPlayer Project

Requirements

This system only requires the "OleLoadPicture" function (Please see LoadPictureFile function in Skindialog.cpp)

How to Use

Please Read This notes and see Sample Directory and MPEGPlayer project
  1. Draw mask bitmap
  2. Draw main Bitmap
  3. If you need or want
    • Draw mouse over bitmap
    • Draw mouse down bitmap
    • Draw disable bitmap
  4. Run Skineditor
  5. Select "Screens" Tab
  6. Fill All Pictures
  7. If you want select "Preview" Button
  8. Save and exit
  9. Run Visual Studio
  10. Create a Dialog based new Project (for example Dialog Name = CBaseDialog)
  11. Include "SkinDialog.h" (for example in "StdAfx.h")
  12. Change to CBaseDialog : public CDialog to CBaseDialog : public CSkinDialog
  13. Go to CBaseDialog::OnInitDialog
  14. Add these lines
    char m_skin[512];
    sprintf(m_skin, "<Your Skin Name>");
    
    // If you want a menu < Activate to Right click > add this line
    SetMenuID(IDR_MAINMENU);
    
    // If you Want Caption 
    SetWindowText("MPEG Player");
    
    // Set To My SkinFile
    SetSkinFile(m_skin);
    CSkinDialog::OnInitDialog();
    
  15. Compile and Run

Controlling Button Clicks, Trackbar, ProgressBar and Text

Here are the protocols for the different events that you might want to handle in the base class (CSkinDialog)...
void ProgresChanged(CString m_Name); // If progress changes
void MouseMoved(CString m_ButtonName, int x, int y); // if Mouse Moved
void TrackChange(CString m_ButtonName, UINT nSBCode, UINT nPos); // if Trackbar change
void ButtonPressed(CString m_ButtonName); // if Button Pressed
You can also add any of these functions to your class depending on your needs.
  • Changing the tooltip Use one of the Set<xxx>ToolTip functions. Where <xxx> is Button, Text, etc. For example:
    SetButtonToolTip("BUTTON_USEEQ", "Equalizer is On");
    
  • Getting Value Use one of the Get<xxx> functions. For example:
    BOOL useEQ = GetButtonCheck("BUTTON_USEEQ"); // if BUTTON_USEEQ checked)
    
  • Setting Value
  • Use one of the Set<xxx> functions. For example:
    SetButtonCheck("BUTTON_USEEQ", useEQ); // if useEQ = True BUTTON_USEEQ is checked)
    

Additional Notes

Thanks for enterested to CSkinsys. But this is first release. It may have any bug and error. Please report any bug and error or any question to me.

Downloads

Download source and demo - 312 Kb


Comments

  • Wonderful ! But it can not skin the window with caption and borders . Appface do it perfectly .

    Posted by marstxj on 01/10/2005 09:55pm

    SkinSys can not skin the window with caption and borders, but appface can . AppFace for VC is no costs for non-commerical use ,you can download it from : http://www.appface.com

    Reply
  • Good, but GDI leak

    Posted by Legacy on 02/13/2004 12:00am

    Originally posted by: Jiun-Yao Huang

    I ran the executable in the .zip file and open the task manager. I found the number of GDI increasing continuously when I hovers the bottons.

    Reply
  • Problems w/ buttons

    Posted by Legacy on 10/09/2003 12:00am

    Originally posted by: Tom

    I am unable to render the buttons for my skinned dialog. Here are the steps I took to create the skin

    1) Create a background bitmap with the buttons drawn on the background (as part of the same bitmap)
    2) Create the mouse down bitmap (same as background w/ different colored buttons)
    3) Create the slider buttons (normal and mouse down)
    4) Create the mask
    5) open the skin editor and add the mask, main and selected bitmaps...
    6) go to the buttons tab and define 4 buttons, their sizes and locations. I verified the locations and sizes in Photoshop and checked the skin from the demo app to make sure my 0,0 location was correct (top left).
    7) go to the sliders tab and create a slider and slider button
    8) create a new dialog based app and add the appropriate calls in OnInitDialog

    When I "Preview" the skin in the skin editor it looks and works perfectly.

    When I launch the app I see the background but the buttons look like some sort of XP default buttons (which are probably drawn when CBitmapButton doesn't have a bitmap to associate w/ the button). They respond to mouse over and mouse down just like an XP button would. So obviously the buttons specified in the skin are not getting rendered to the screen. The slider is drawn and works perfectly.

    I plan on doing more debugging and also trying my skin w/ the demo project to see what happens but it would be great if someone has an idea as to why this is happening.


    • Replace CDialog::OnPaint with CSkinDialog::OnPaint()

      Posted by pivorules on 04/26/2004 11:54pm

      In your dialog's OnPaint method, replace CDialog with CSkingDialog. In face, you may want to do this for all occurances in your dialog code.

      Reply
    • Did you find the answer already?

      Posted by Noam3.1 on 04/13/2004 01:01pm

      Hi I have the same problem on XP Did you find the answer already?

      Reply
    Reply
  • http://www.ucancode.net

    Posted by Legacy on 05/13/2003 12:00am

    Originally posted by: XD++ MFC Library with Source Code

    The best kit

    Reply
  • Displaying label

    Posted by Legacy on 02/18/2003 12:00am

    Originally posted by: Yves

    Hi,
    I have just a simple question :
    Is it possible to display Label text with left aligment ?
    When I define my label area, I can choose policy, color, position, etc but not the aligment ??

    May I have to call the SetTextAlign API somewhere ?

    Thks for your help
    Yves

    Reply
  • SkinMagic SDK : I think it's the best solution for write skinnable application for C/C++ user!

    Posted by Legacy on 01/22/2003 12:00am

    Originally posted by: joe

    http://www.appspeed.com
    SkinMagic SDK : I think it's the best solution for write skinnable application for C/C++ user!

    Reply
  • spectrum analyzer

    Posted by Legacy on 06/03/2002 12:00am

    Originally posted by: matt ragnarsson

    how can I insert a spectrum analyzer within this?

    Reply
  • small problem

    Posted by Legacy on 05/06/2002 12:00am

    Originally posted by: Bao

    when I call
    1. MPPlayer::SetLimits(pos1, pos2)
    2. MPPlayer::SetPos(pos1)
    3. MPPlayer::Play()
    then I call MPPlayer::Pause() when MPPlayer::GetPos() is at pos2. But when I call this function again, the result is not the same(the output sound is different from the first time). why? Please help me!

    Reply
  • lol

    Posted by Legacy on 04/21/2002 12:00am

    Originally posted by: lol

    lol, people are dumb. how does a spectrum analyser even SORTOF relate (in code similarities) to a skinning package.

    Newbs, go read more books & quick spamming sh*t like that.

    Reply
  • Realy great work but can I ......

    Posted by Legacy on 03/06/2002 12:00am

    Originally posted by: Fred Junier

    I have made a SKINSYS.LIB from the files and it works very
    
    good.
    I also put some MFC components in it like a 2 drag and drop listviews.
    When I run my dialog with a skin image and the 2 listviews
    and I move my dialog behind an other window and back my
    listview or a part of the listview seems to be disappear.
    Can somebody help me to solve this problem I think its a
    refresh problem.

    Reply
  • Loading, Please Wait ...

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Learn How A Global Entertainment Company Saw a 448% ROI Every business today uses software to manage systems, deliver products, and empower employees to do their jobs. But software inevitably breaks, and when it does, businesses lose money -- in the form of dissatisfied customers, missed SLAs or lost productivity. PagerDuty, an operations performance platform, solves this problem by helping operations engineers and developers more effectively manage and resolve incidents across a company's global operations. …

  • Today's agile organizations pose operations teams with a tremendous challenge: to deploy new releases to production immediately after development and testing is completed. To ensure that applications are deployed successfully, an automatic and transparent process is required. We refer to this process as Zero Touch Deployment™. This white paper reviews two approaches to Zero Touch Deployment--a script-based solution and a release automation platform. The article discusses how each can solve the key …

Most Popular Programming Stories

More for Developers

RSS Feeds