牵着老婆满街逛

严以律己,宽以待人. 三思而后行.
GMail/GTalk: yanglinbo#google.com;
MSN/Email: tx7do#yahoo.com.cn;
QQ: 3 0 3 3 9 6 9 2 0 .

Creating Skins with SkinSys Ver 1.0

Cuneyt Elibol (view profile)
July 26, 2000

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 changesvoid MouseMoved(CString m_ButtonName, int x, int y); // if Mouse Movedvoid TrackChange(CString m_ButtonName, UINT nSBCode, UINT nPos); // if Trackbar changevoid 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

posted on 2006-06-22 20:37 杨粼波 阅读(589) 评论(1)  编辑 收藏 引用 所属分类: 文章收藏

评论

# re: Creating Skins with SkinSys Ver 1.0 2007-09-22 09:19 www

Skineditor 哪里下?
mail:wohei2006@21cn.com  回复  更多评论   


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理