home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 November / CMCD1104.ISO / Software / Shareware / Programare / skincraft / SkinCrafter_v1.4.12_Demo.msi / _49E29CB9A65AABBF653C1037E1AA74B6 / _EF324ACAC9694FAF8E4171A1659321E7 (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2004-07-29  |  17.3 KB  |  529 lines

  1. VERSION 5.00
  2. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
  3. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
  4. Object = "{FE666755-7DB5-47B5-9F9E-ABC3D730AF26}#1.0#0"; "SCLabel.ocx"
  5. Begin VB.Form Form1 
  6.    Caption         =   "Form1"
  7.    ClientHeight    =   5715
  8.    ClientLeft      =   555
  9.    ClientTop       =   1125
  10.    ClientWidth     =   5850
  11.    ClipControls    =   0   'False
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   5715
  14.    ScaleWidth      =   5850
  15.    StartUpPosition =   2  'CenterScreen
  16.    Begin VB.VScrollBar VScroll2 
  17.       Height          =   1095
  18.       Left            =   2520
  19.       TabIndex        =   28
  20.       Top             =   600
  21.       Width           =   255
  22.    End
  23.    Begin SCLABELLib.SCLabel SCLabel3 
  24.       Height          =   375
  25.       Left            =   4320
  26.       TabIndex        =   27
  27.       Top             =   2280
  28.       Width           =   1335
  29.       _Version        =   65536
  30.       _ExtentX        =   2355
  31.       _ExtentY        =   661
  32.       _StockProps     =   13
  33.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  34.          Name            =   "MS Sans Serif"
  35.          Size            =   8.24
  36.          Charset         =   204
  37.          Weight          =   400
  38.          Underline       =   0   'False
  39.          Italic          =   0   'False
  40.          Strikethrough   =   0   'False
  41.       EndProperty
  42.       Caption         =   "SCLabel rigth"
  43.       Alignment       =   3
  44.       Enabled         =   -1  'True
  45.    End
  46.    Begin SCLABELLib.SCLabel SCLabel2 
  47.       Height          =   255
  48.       Left            =   1920
  49.       TabIndex        =   22
  50.       Top             =   2280
  51.       Width           =   2175
  52.       _Version        =   65536
  53.       _ExtentX        =   3836
  54.       _ExtentY        =   450
  55.       _StockProps     =   13
  56.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  57.          Name            =   "MS Sans Serif"
  58.          Size            =   8.25
  59.          Charset         =   204
  60.          Weight          =   400
  61.          Underline       =   0   'False
  62.          Italic          =   0   'False
  63.          Strikethrough   =   0   'False
  64.       EndProperty
  65.       Caption         =   "SCLabel desabled centered"
  66.       Alignment       =   2
  67.       Enabled         =   0   'False
  68.    End
  69.    Begin SCLABELLib.SCLabel SCLabel1 
  70.       Height          =   255
  71.       Left            =   240
  72.       TabIndex        =   21
  73.       Top             =   2280
  74.       Width           =   1335
  75.       _Version        =   65536
  76.       _ExtentX        =   2355
  77.       _ExtentY        =   450
  78.       _StockProps     =   13
  79.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  80.          Name            =   "MS Sans Serif"
  81.          Size            =   8.25
  82.          Charset         =   204
  83.          Weight          =   400
  84.          Underline       =   0   'False
  85.          Italic          =   0   'False
  86.          Strikethrough   =   0   'False
  87.       EndProperty
  88.       Caption         =   "SCLabel left"
  89.       Alignment       =   1
  90.       Enabled         =   -1  'True
  91.    End
  92.    Begin VB.ComboBox Combo3 
  93.       Enabled         =   0   'False
  94.       Height          =   315
  95.       Left            =   240
  96.       TabIndex        =   19
  97.       Text            =   "Combo3"
  98.       Top             =   5160
  99.       Width           =   1575
  100.    End
  101.    Begin VB.ComboBox Combo2 
  102.       Height          =   315
  103.       Left            =   240
  104.       TabIndex        =   18
  105.       Text            =   "Combo2"
  106.       Top             =   4680
  107.       Width           =   1575
  108.    End
  109.    Begin VB.CommandButton Command3 
  110.       Caption         =   "Set skin directory"
  111.       Height          =   375
  112.       Left            =   240
  113.       TabIndex        =   17
  114.       Top             =   1680
  115.       Width           =   1815
  116.    End
  117.    Begin VB.TextBox Text4 
  118.       Height          =   855
  119.       Left            =   3960
  120.       MultiLine       =   -1  'True
  121.       ScrollBars      =   3  'Both
  122.       TabIndex        =   16
  123.       Text            =   "Form1.frx":0000
  124.       Top             =   1200
  125.       Width           =   1695
  126.    End
  127.    Begin VB.CommandButton Command2 
  128.       Caption         =   "ApplySkin"
  129.       Height          =   375
  130.       Left            =   240
  131.       TabIndex        =   15
  132.       Top             =   1200
  133.       Width           =   1815
  134.    End
  135.    Begin VB.CommandButton Command1 
  136.       Caption         =   "RemoveSkin"
  137.       Height          =   375
  138.       Left            =   240
  139.       TabIndex        =   14
  140.       Top             =   720
  141.       Width           =   1815
  142.    End
  143.    Begin VB.Frame Frame4 
  144.       Caption         =   "RadioButton"
  145.       Height          =   1695
  146.       Left            =   120
  147.       TabIndex        =   13
  148.       Top             =   2640
  149.       Width           =   1095
  150.       Begin VB.CheckBox Check1 
  151.          Caption         =   "Skin1"
  152.          Height          =   255
  153.          Left            =   120
  154.          TabIndex        =   26
  155.          Top             =   240
  156.          Width           =   735
  157.       End
  158.       Begin VB.OptionButton Option1 
  159.          Caption         =   "Skin1"
  160.          Height          =   255
  161.          Left            =   120
  162.          TabIndex        =   25
  163.          Top             =   960
  164.          Width           =   735
  165.       End
  166.       Begin VB.CheckBox Check2 
  167.          Caption         =   "Skin2"
  168.          Height          =   255
  169.          Left            =   120
  170.          TabIndex        =   24
  171.          Top             =   600
  172.          Width           =   735
  173.       End
  174.       Begin VB.OptionButton Option2 
  175.          Caption         =   "Skin2"
  176.          Height          =   255
  177.          Left            =   120
  178.          TabIndex        =   23
  179.          Top             =   1320
  180.          Width           =   735
  181.       End
  182.    End
  183.    Begin ComctlLib.TabStrip TabStrip1 
  184.       Height          =   1095
  185.       Left            =   2040
  186.       TabIndex        =   12
  187.       Top             =   4560
  188.       Width           =   2055
  189.       _ExtentX        =   3625
  190.       _ExtentY        =   1931
  191.       _Version        =   327682
  192.       BeginProperty Tabs {0713E432-850A-101B-AFC0-4210102A8DA7} 
  193.          NumTabs         =   1
  194.          BeginProperty Tab1 {0713F341-850A-101B-AFC0-4210102A8DA7} 
  195.             Caption         =   ""
  196.             Key             =   ""
  197.             Object.Tag             =   ""
  198.             ImageVarType    =   2
  199.          EndProperty
  200.       EndProperty
  201.    End
  202.    Begin VB.TextBox Text2 
  203.       Enabled         =   0   'False
  204.       Height          =   375
  205.       Left            =   3960
  206.       TabIndex        =   9
  207.       Text            =   "Text2"
  208.       Top             =   720
  209.       Width           =   1695
  210.    End
  211.    Begin VB.Frame Frame1 
  212.       Caption         =   "Skin set"
  213.       Height          =   2175
  214.       Left            =   120
  215.       TabIndex        =   7
  216.       Top             =   0
  217.       Width           =   2055
  218.       Begin VB.ComboBox Combo1 
  219.          Height          =   315
  220.          Left            =   120
  221.          Style           =   2  'Dropdown List
  222.          TabIndex        =   8
  223.          Top             =   240
  224.          Width           =   1815
  225.       End
  226.    End
  227.    Begin MSComctlLib.Slider Slider1 
  228.       Height          =   375
  229.       Left            =   4200
  230.       TabIndex        =   6
  231.       Top             =   4560
  232.       Width           =   1575
  233.       _ExtentX        =   2778
  234.       _ExtentY        =   661
  235.       _Version        =   393216
  236.    End
  237.    Begin VB.VScrollBar VScroll1 
  238.       Enabled         =   0   'False
  239.       Height          =   1095
  240.       Left            =   3240
  241.       TabIndex        =   5
  242.       Top             =   600
  243.       Width           =   255
  244.    End
  245.    Begin ComctlLib.ListView ListView1 
  246.       Height          =   1620
  247.       Index           =   0
  248.       Left            =   1320
  249.       TabIndex        =   4
  250.       Top             =   2760
  251.       Width           =   2775
  252.       _ExtentX        =   4895
  253.       _ExtentY        =   2858
  254.       View            =   2
  255.       LabelWrap       =   -1  'True
  256.       HideSelection   =   -1  'True
  257.       _Version        =   327682
  258.       ForeColor       =   -2147483640
  259.       BackColor       =   -2147483643
  260.       BorderStyle     =   1
  261.       Appearance      =   1
  262.       NumItems        =   0
  263.    End
  264.    Begin ComctlLib.ProgressBar ProgressBar1 
  265.       Height          =   255
  266.       Left            =   4200
  267.       TabIndex        =   3
  268.       Top             =   5280
  269.       Width           =   1575
  270.       _ExtentX        =   2778
  271.       _ExtentY        =   450
  272.       _Version        =   327682
  273.       Appearance      =   1
  274.    End
  275.    Begin VB.ListBox List1 
  276.       Height          =   1620
  277.       Left            =   4200
  278.       TabIndex        =   2
  279.       Top             =   2760
  280.       Width           =   1455
  281.    End
  282.    Begin VB.HScrollBar HScroll1 
  283.       Height          =   255
  284.       Left            =   2400
  285.       TabIndex        =   1
  286.       Top             =   240
  287.       Width           =   1215
  288.    End
  289.    Begin VB.TextBox Text1 
  290.       Height          =   375
  291.       Left            =   3960
  292.       TabIndex        =   0
  293.       Text            =   "Text1"
  294.       Top             =   240
  295.       Width           =   1695
  296.    End
  297.    Begin VB.Frame Frame2 
  298.       Caption         =   "ScrollBar"
  299.       Height          =   2175
  300.       Left            =   2280
  301.       TabIndex        =   10
  302.       Top             =   0
  303.       Width           =   1455
  304.       Begin VB.HScrollBar HScroll2 
  305.          Enabled         =   0   'False
  306.          Height          =   255
  307.          Left            =   120
  308.          TabIndex        =   29
  309.          Top             =   1800
  310.          Width           =   1215
  311.       End
  312.    End
  313.    Begin VB.Frame Frame3 
  314.       Caption         =   "Edit"
  315.       Height          =   2175
  316.       Left            =   3840
  317.       TabIndex        =   11
  318.       Top             =   0
  319.       Width           =   1935
  320.    End
  321.    Begin VB.Frame Frame5 
  322.       Caption         =   "Combobox"
  323.       Height          =   1215
  324.       Left            =   120
  325.       TabIndex        =   20
  326.       Top             =   4440
  327.       Width           =   1815
  328.    End
  329.    Begin VB.Menu File 
  330.       Caption         =   "File"
  331.       Begin VB.Menu Open 
  332.          Caption         =   "Open"
  333.       End
  334.       Begin VB.Menu Exit 
  335.          Caption         =   "Exit"
  336.       End
  337.    End
  338.    Begin VB.Menu Help 
  339.       Caption         =   "Help"
  340.       Begin VB.Menu About 
  341.          Caption         =   "About"
  342.       End
  343.    End
  344. Attribute VB_Name = "Form1"
  345. Attribute VB_GlobalNameSpace = False
  346. Attribute VB_Creatable = False
  347. Attribute VB_PredeclaredId = True
  348. Attribute VB_Exposed = False
  349. Dim fso As New FileSystemObject
  350. Dim SkinNames(256) As String
  351. Private SkinOb As New SKINCRAFTERLib.SCSkin
  352. Private Declare Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OpenFilename) As Long
  353. Private Const BIF_RETURNONLYFSDIRS = 1
  354. Private Const BIF_DONTGOBELOWDOMAIN = 2
  355. Private Const MAX_PATH = 260
  356. Private Declare Function SHBrowseForFolder Lib "shell32" _
  357.                              (lpbi As BrowseInfo) As Long
  358. Private Declare Function SHGetPathFromIDList Lib "shell32" _
  359.                              (ByVal pidList As Long, _
  360.                              ByVal lpBuffer As String) As Long
  361. Private Declare Function lstrcat Lib "kernel32" Alias "lstrcatA" _
  362.                              (ByVal lpString1 As String, ByVal _
  363.                              lpString2 As String) As Long
  364. Private Type BrowseInfo
  365.     hWndOwner      As Long
  366.     pIDLRoot       As Long
  367.     pszDisplayName As Long
  368.     lpszTitle      As Long
  369.     ulFlags        As Long
  370.     lpfnCallback   As Long
  371.     lParam         As Long
  372.     iImage         As Long
  373. End Type
  374. Private Type OpenFilename
  375.     lStructSize As Long
  376.     hWndOwner As Long
  377.     hInstance As Long
  378.     lpstrFilter As String
  379.     lpstrCustomFilter As String
  380.     nMaxCustFilter As Long
  381.     iFilterIndex As Long
  382.     lpstrFile As String
  383.     nMaxFile As Long
  384.     lpstrFileTitle As String
  385.     nMaxFileTitle As Long
  386.     lpstrInitialDir As String
  387.     lpstrTitle As String
  388.     Flags As Long
  389.     nFileOffset As Integer
  390.     nFileExtension As Integer
  391.     lpstrDefExt As String
  392.     lCustData As Long
  393.     lpfnHook As Long
  394.     lpTemplateName As String
  395. End Type
  396. Private Function ShowFileDialog() As String
  397.     Dim ofn As OpenFilename
  398.     ofn.lStructSize = Len(ofn)
  399.     ofn.hWndOwner = hWnd
  400.     ofn.lpstrFilter = "SkinCrafter files (*.skf)" & Chr$(0) & "*.skf" & Chr$(0) & Chr(0) & Chr(0)
  401.     ofn.lpstrFile = String(256, 0)
  402.     ofn.nMaxFile = 255
  403.     ofn.lpstrTitle = "Open Skin"
  404.     ofn.Flags = &H800000 + &H1000 + &H8 + &H4
  405.     ofn.lpstrDefExt = "skf" + Chr(0)
  406.     GetOpenFileName ofn
  407.     If Mid(ofn.lpstrFile, 1, 1) <> Chr(0) Then ShowFileDialog = ofn.lpstrFile
  408. End Function
  409. Private Sub About_Click()
  410.     SkinOb.AboutSkinCrafter
  411. End Sub
  412. Private Sub Combo1_Click()
  413.     SkinOb.LoadSkinFromFile SkinNames(Combo1.ListIndex)
  414.     SkinOb.ApplySkin
  415.     SkinOb.UpdateControl 0
  416. End Sub
  417. Private Sub Command1_Click()
  418.     SkinOb.RemoveSkin
  419. End Sub
  420. Private Sub Command2_Click()
  421.     SkinOb.ApplySkin
  422. End Sub
  423. Private Function BrowseProc(hWnd As Long, uMsg As Long, lParam As Long, lpData As Long)
  424. End Function
  425. Private Sub Command3_Click()
  426.     Dim lpIDList As Long
  427.     Dim szTitle As String
  428.     Dim tBrowseInfo As BrowseInfo
  429.     Dim sDir As String
  430.     szTitle = "This is the title"
  431.     With tBrowseInfo
  432.        .hWndOwner = Me.hWnd
  433.        .lpszTitle = lstrcat(szTitle, "")
  434.        .ulFlags = BIF_RETURNONLYFSDIRS + BIF_DONTGOBELOWDOMAIN
  435.     End With
  436.     lpIDList = SHBrowseForFolder(tBrowseInfo)
  437.     If (lpIDList) Then
  438.        sDir = Space(MAX_PATH)
  439.        SHGetPathFromIDList lpIDList, sDir
  440.        sDir = Left(sDir, InStr(sDir, vbNullChar) - 1)
  441.        lSize = FillSkinName(sDir, "*.skf")
  442.     End If
  443. End Sub
  444. Private Sub Exit_Click()
  445.     Unload Me
  446.     SkinOb.DeInitDecoration
  447. End Sub
  448. Private Sub Form_Initialize()
  449. SkinOb.InitLicenKeys "0", "SKINCRAFTER", "SKINCRAFTER.COM", "support@skincrafter.com", "DEMOSKINCRAFTERLICENCE"
  450. SkinOb.DefineLanguage 2
  451. SkinOb.InitDecoration 1
  452. End Sub
  453. Private Sub Form_Load()
  454.     List1.AddItem "ScinCrafter 0"
  455.     List1.AddItem "ScinCrafter 1"
  456.     List1.AddItem "ScinCrafter 2"
  457.     List1.AddItem "ScinCrafter 3"
  458.     List1.AddItem "ScinCrafter 4"
  459.     ProgressBar1.Value = 50
  460.     'TreeView1.LineStyle = tvwRootLines
  461.     'TreeView1.Nodes.Add , , "TopLevelBranch1", "TopLevelBranch1"
  462.     'TreeView1.Nodes.Add "TopLevelBranch1", tvwChild, "SubBranch1_1", "SubBranch1_1"
  463.     'TreeView1.Nodes.Add "SubBranch1_1", tvwChild, "Node1_1_1", "Node1_1_1"
  464.     'TreeView1.Nodes.Add "SubBranch1_1", tvwChild, "Node1_1_2", "Node1_1_2"
  465.     'TreeView1.Nodes.Add "SubBranch1_1", tvwChild, "Node1_1_3", "Node1_1_3"
  466.     'TreeView1.Nodes.Add "TopLevelBranch1", tvwChild, "SubBranch1_2", "SubBranch1_2"
  467.     'TreeView1.Nodes.Add "SubBranch1_2", tvwChild, "Node1_2_1", "Node1_2_1"
  468.     'TreeView1.Nodes.Add "SubBranch1_2", tvwChild, "Node1_2_2", "Node1_2_2"
  469.     'TreeView1.Nodes.Add , , "TopLevelBranch2", "TopLevelBranch2"
  470.     'TreeView1.Nodes.Add "TopLevelBranch2", tvwChild, "SubBranch2_1", "SubBranch2_1"
  471.     'TreeView1.Nodes.Add "TopLevelBranch2", tvwChild, "SubBranch2_2", "SubBranch2_2"
  472.     'TreeView1.Nodes.Add "SubBranch2_2", tvwChild, "Node2_2_1", "Node2_2_1"
  473.     ' Set view to report
  474.     ListView1(0).View = lvwReport
  475.     ' Add some columns to listview
  476.     ListView1(0).ColumnHeaders.Add , "col1", "col1"
  477.     ListView1(0).ColumnHeaders.Add , "col2", "col2"
  478.     ListView1(0).ColumnHeaders.Add , "col3", "col3"
  479.     For j = 1 To 10
  480.          Set objListItem = ListView1(0).ListItems.Add(, , "data1-" & j)
  481.          objListItem.SubItems(1) = "data2-" & j
  482.          objListItem.SubItems(2) = "data3-" & j
  483.          
  484.          ' Set the tag property of the new ListItem
  485.          objListItem.Tag = j
  486.     Next j
  487.     TabStrip1.Tabs.Remove 1
  488.     TabStrip1.Tabs.Add , , "Text1"
  489.     TabStrip1.Tabs.Add , , "Text1"
  490.     For j = 1 To 10
  491.          Combo2.AddItem "Skin1"
  492.     Next j
  493.     Combo2.Text = Combo2.List(0)
  494. End Sub
  495. Private Sub Form_Terminate()
  496.      SkinOb.DeInitDecoration
  497. End Sub
  498. Private Sub Open_Click()
  499.     Dim FileName As String
  500.     FileName = ShowFileDialog
  501.     If FileName <> "" Then
  502.         SkinOb.LoadSkinFromFile FileName
  503.         SkinOb.ApplySkin
  504.         SkinOb.UpdateControl 0
  505.     End If
  506. End Sub
  507. Private Function FillSkinName(ByVal sFol As String, sFile As String) As Long
  508.     Dim FileName As String, SkinName As String, Path As String
  509.     Dim I As Integer
  510.     Combo1.Clear
  511.     Set fld = fso.GetFolder(sFol)
  512.     FileName = Dir(fso.BuildPath(fld.Path, sFile), vbNormal Or _
  513.                     vbHidden Or vbSystem Or vbReadOnly)
  514.     While Len(FileName) <> 0
  515.        FindFile = FindFile + FileLen(fso.BuildPath(fld.Path, _
  516.                                      FileName))
  517.                                      
  518.        SkinOb.GetSkinCopyRight fso.BuildPath(fld.Path, FileName), SkinName, "", "", ""
  519.        
  520.        Combo1.AddItem SkinName
  521.        SkinNames(Combo1.NewIndex) = fso.BuildPath(fld.Path, FileName)
  522.        
  523.        FileName = Dir()  ' Get next file
  524.        DoEvents
  525.     Wend
  526.       
  527.     Combo1.ListIndex = 0
  528. End Function
  529.