home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{85A31727-F64B-11D2-886C-B123251DAC7D}#30.0#0"; "NPPalPager.ocx"
- Begin VB.Form Form1
- Caption = "Test NPPalPager"
- ClientHeight = 5430
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 9300
- LinkTopic = "Form1"
- ScaleHeight = 5430
- ScaleWidth = 9300
- StartUpPosition = 3 'Windows Default
- Begin PalPager.NPPalPager NPPalPager1
- Align = 2 'Align Bottom
- Height = 615
- Left = 0
- TabIndex = 37
- Top = 4815
- Width = 9300
- _ExtentX = 16404
- _ExtentY = 1085
- Valeur_RGB(0) = ""
- Valeur_HEXA(0) = ""
- Border_Style = 3
- MaxSelected = 0
- Color_Selected(0)= 0
- End
- Begin VB.CommandButton Command7
- Caption = "Open Palette avec erreur"
- Height = 255
- Left = 3480
- TabIndex = 36
- Top = 4560
- Width = 2055
- End
- Begin VB.CommandButton Command6
- Caption = "Save Palette"
- Height = 255
- Left = 1800
- TabIndex = 35
- Top = 4560
- Width = 1575
- End
- Begin VB.CommandButton Command5
- Caption = "Change Color"
- Height = 255
- Left = 120
- TabIndex = 34
- Top = 4560
- Width = 1575
- End
- Begin VB.CommandButton Command1
- Caption = "Fade Colors"
- Height = 375
- Index = 2
- Left = 3240
- TabIndex = 33
- Top = 2400
- Width = 1335
- End
- Begin VB.CommandButton Command1
- Caption = "Create Fade palette"
- Height = 375
- Index = 1
- Left = 1560
- TabIndex = 32
- Top = 2400
- Width = 1575
- End
- Begin VB.CommandButton Command4
- Caption = "Rechercher"
- Height = 375
- Left = 7320
- TabIndex = 22
- Top = 2400
- Width = 1935
- End
- Begin VB.Frame Frame2
- Caption = "Rechercher:"
- Height = 1935
- Left = 7320
- TabIndex = 15
- Top = 360
- Width = 1935
- Begin VB.TextBox Text3
- Height = 285
- Index = 2
- Left = 1200
- TabIndex = 21
- Top = 1440
- Width = 495
- End
- Begin VB.TextBox Text3
- Height = 285
- Index = 1
- Left = 720
- TabIndex = 20
- Top = 1440
- Width = 495
- End
- Begin VB.TextBox Text3
- Height = 285
- Index = 0
- Left = 240
- TabIndex = 18
- Top = 1440
- Width = 495
- End
- Begin VB.TextBox Text2
- Height = 285
- Left = 240
- TabIndex = 16
- Text = "&H000000"
- Top = 480
- Width = 1455
- End
- Begin VB.Label Label4
- Alignment = 2 'Center
- Caption = "OU"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 240
- TabIndex = 23
- Top = 900
- Width = 1455
- End
- Begin VB.Label Label3
- Caption = "Valeur RGB:"
- Height = 255
- Index = 1
- Left = 240
- TabIndex = 19
- Top = 1200
- Width = 1455
- End
- Begin VB.Label Label3
- Caption = "Valeur Hexa:"
- Height = 255
- Index = 0
- Left = 240
- TabIndex = 17
- Top = 240
- Width = 1455
- End
- End
- Begin VB.Frame Frame1
- Caption = "Entr
- es de la palette active:"
- Height = 1575
- Left = 120
- TabIndex = 11
- Top = 2880
- Width = 9135
- Begin VB.ListBox List5
- Height = 1035
- Index = 2
- Left = 7080
- TabIndex = 26
- Top = 480
- Width = 735
- End
- Begin VB.ListBox List5
- Height = 1035
- Index = 1
- Left = 6360
- TabIndex = 25
- Top = 480
- Width = 735
- End
- Begin VB.ListBox List5
- Height = 1035
- Index = 0
- Left = 5640
- TabIndex = 24
- Top = 480
- Width = 735
- End
- Begin VB.ListBox List4
- Height = 1035
- Left = 2880
- TabIndex = 14
- Top = 480
- Width = 2655
- End
- Begin VB.CommandButton Command3
- Caption = "GetEntries"
- Height = 975
- Left = 7920
- TabIndex = 13
- Top = 360
- Width = 1095
- End
- Begin VB.ListBox List3
- Height = 1035
- Left = 120
- TabIndex = 12
- Top = 480
- Width = 2655
- End
- Begin VB.Label Label5
- Caption = "Blue:"
- Height = 255
- Index = 4
- Left = 7080
- TabIndex = 31
- Top = 240
- Width = 735
- End
- Begin VB.Label Label5
- Caption = "Green:"
- Height = 255
- Index = 3
- Left = 6360
- TabIndex = 30
- Top = 240
- Width = 735
- End
- Begin VB.Label Label5
- Caption = "Red:"
- Height = 255
- Index = 2
- Left = 5640
- TabIndex = 29
- Top = 240
- Width = 735
- End
- Begin VB.Label Label5
- Caption = "HEXA:"
- Height = 255
- Index = 1
- Left = 2880
- TabIndex = 28
- Top = 240
- Width = 2655
- End
- Begin VB.Label Label5
- Caption = "RGB:"
- Height = 255
- Index = 0
- Left = 120
- TabIndex = 27
- Top = 240
- Width = 2655
- End
- End
- Begin VB.CommandButton Command2
- Caption = "GetInfo"
- Height = 375
- Left = 4680
- TabIndex = 10
- Top = 2400
- Width = 2535
- End
- Begin VB.TextBox Text1
- BeginProperty Font
- Name = "Courier New"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 1935
- Left = 4680
- MultiLine = -1 'True
- ScrollBars = 3 'Both
- TabIndex = 9
- Top = 360
- Width = 2535
- End
- Begin VB.ListBox List2
- Height = 645
- Index = 2
- Left = 3240
- TabIndex = 5
- Top = 1680
- Width = 1335
- End
- Begin VB.ListBox List2
- Height = 645
- Index = 1
- Left = 1680
- TabIndex = 4
- Top = 1680
- Width = 1335
- End
- Begin VB.ListBox List2
- Height = 645
- Index = 0
- Left = 120
- TabIndex = 3
- Top = 1680
- Width = 1335
- End
- Begin VB.CommandButton Command1
- Caption = "Create palette"
- Height = 375
- Index = 0
- Left = 120
- TabIndex = 2
- Top = 2400
- Width = 1335
- End
- Begin VB.ListBox List1
- Height = 1035
- Left = 120
- TabIndex = 0
- Top = 360
- Width = 4455
- End
- Begin VB.Label Label2
- Caption = "Bleu:"
- Height = 255
- Index = 2
- Left = 3240
- TabIndex = 8
- Top = 1440
- Width = 1335
- End
- Begin VB.Label Label2
- Caption = "Vert:"
- Height = 255
- Index = 1
- Left = 1680
- TabIndex = 7
- Top = 1440
- Width = 1335
- End
- Begin VB.Label Label2
- Caption = "Rouge:"
- Height = 255
- Index = 0
- Left = 120
- TabIndex = 6
- Top = 1440
- Width = 1335
- End
- Begin VB.Label Label1
- Caption = "Couleurs s
- lectionn
- Height = 255
- Left = 120
- TabIndex = 1
- Top = 120
- Width = 4455
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub Command1_Click(Index As Integer)
- Dim Rouge(256) As Byte, Vert(256) As Byte, Bleu(256) As Byte
- Select Case Index
- Case 0
- If List1.ListCount < 1 Then Exit Sub
- For i = 0 To List1.ListCount - 1
- Rouge(i) = List2(0).List(i)
- Vert(i) = List2(1).List(i)
- Bleu(i) = List2(2).List(i)
- Next i
- NPPalPager1.CreatePal Rouge, Vert, Bleu, List1.ListCount
- Case 1
- NPPalPager1.CreateFadePalette RGB(255, 0, 0), RGB(255, 255, 0), 255
- Case 2
- If NPPalPager1.MaxSelected <> 2 Then
- MsgBox "Vous devez s
- lectionner 2 couleurs"
- NPPalPager1.Refresh
- Exit Sub
- NPPalPager1.FadeColors
- NPPalPager1.Refresh
- End If
- End Select
- End Sub
- Private Sub Command2_Click()
- Dim Infos As String
- Text1.Text = ""
- Infos = "Version: " & NPPalPager1.GetInfo([Pal Version]) & vbCrLf & _
- "Nombre d'entr
- es: " & NPPalPager1.GetInfo([Pal NumEntries]) & vbCrLf & _
- "Taille: " & NPPalPager1.GetInfo([Pal Size]) & "Ko" & vbCrLf & _
- "Type Flags: " & NPPalPager1.GetInfo([Pal Flags]) & vbCrLf & _
- "Handle palette: " & NPPalPager1.GetInfo(Handle)
- Text1.Text = Infos
- End Sub
- Private Sub Command3_Click()
- Dim NBEntries As Integer
- NBEntries = NPPalPager1.GetInfo([Pal NumEntries])
- List3.Clear
- List4.Clear
- For i = 0 To 2
- List5(i).Clear
- Next i
- For i = 0 To NBEntries - 1
- List3.AddItem NPPalPager1.GetEntries(i, RVB)
- List4.AddItem NPPalPager1.GetEntries(i, HEXA)
- List5(0).AddItem NPPalPager1.GetEntries(i, PRed)
- List5(1).AddItem NPPalPager1.GetEntries(i, PGreen)
- List5(2).AddItem NPPalPager1.GetEntries(i, PBlue)
- Next i
- End Sub
- Private Sub Command4_Click()
- If Text3(0).Text = "" Then
- NPPalPager1.SearchColor Text2.Text, HEXA
- NPPalPager1.SearchColor RGB(Text3(0).Text, Text3(1).Text, Text3(2).Text), RVB
- End If
- NPPalPager1_Click
- End Sub
- Private Sub Command5_Click()
- If NPPalPager1.MaxSelected <> 1 Then
- MsgBox "Vous devez s
- lectionner 1 couleur"
- NPPalPager1.Refresh
- Exit Sub
- NPPalPager1.ChangeColor RGB(255, 255, 255)
- End If
- End Sub
- Private Sub Command6_Click()
- NPPalPager1.SavePalette "C:\palette.pal", PalWin
- End Sub
- Private Sub Command7_Click()
- NPPalPager1.Palette = "c:\esd.pal"
- NPPalPager1.ErrMessage = "Erreur de lecture du fichier c:\esd.pal."
- NPPalPager1.ErrTitle = App.EXEName
- End Sub
- Private Sub Form_Load()
- If Right(App.Path, 1) <> "\" Then
- NPPalPager1.Palette = App.Path & "\" & "logo.pal"
- NPPalPager1.Palette = App.Path & "logo.pal"
- End If
- End Sub
- Private Sub NPPalPager1_Click()
- List1.Clear
- For i = 0 To 2
- List2(i).Clear
- Next i
- For i = 0 To NPPalPager1.MaxSelected - 1
- If NPPalPager1.Valeur_INDEX(i) < 100 Then
- List1.AddItem "Index: " & NPPalPager1.Valeur_INDEX(i) & Chr(9) & Chr(9) & "Hex: " & NPPalPager1.Valeur_HEXA(i) & Chr(9) & "Rgb: " & NPPalPager1.Valeur_RGB(i)
- List1.AddItem "Index: " & NPPalPager1.Valeur_INDEX(i) & Chr(9) & "Hex: " & NPPalPager1.Valeur_HEXA(i) & Chr(9) & "Rgb: " & NPPalPager1.Valeur_RGB(i)
- End If
- List2(0).AddItem NPPalPager1.Red(i)
- List2(1).AddItem NPPalPager1.Green(i)
- List2(2).AddItem NPPalPager1.Blue(i)
- Next i
- End Sub
- Private Sub Text2_Click()
- For i = 0 To 2
- Text3(i).Text = ""
- Next i
- Text2.SelStart = 0
- Text2.SelLength = Len(Text2.Text)
- End Sub
- Private Sub Text2_GotFocus()
- Text2_Click
- End Sub
- Private Sub Text3_Click(Index As Integer)
- Text2.Text = ""
- Text3(Index).SelStart = 0
- Text3(Index).SelLength = Len(Text3(Index).Text)
- End Sub
- Private Sub Text3_GotFocus(Index As Integer)
- Text3_Click (Index)
- End Sub
-