#
# This file is a part of the NsCDE - Not so Common Desktop Environment
# Author: Hegel3DReloaded
# Licence: GPLv3
#

WindowTitle { Number Of Colors To Use }
WindowSize 280 294
Colorset 22

Init
Begin
   Set $Ncolors = (GetScriptArgument 1)
   If $Ncolors == {} Then
   Begin
      Set $Ncolors = 8
   End

   ChangeValue 5 1

   Set $DefaultTitle = {Default (} $Ncolors {)}
   ChangeTitle 5 $DefaultTitle

   # Keybindings
   Key Escape A 8 1 {KeyClose}
   Key F1 A 9 1 {KeyHelp}
   Key Help A 9 1 {KeyHelp}
End

Widget 1
   Property
   Size 20 32
   Position 10 4
   Type ItemDraw
   Flags NoReliefString
   Title {}
   Icon NsCDE/DtColor.xpm
   Main
      Case message of
      SingleClic :
      Begin
      End
End

Widget 2
Property
   Size 264 170
   Position 8 54
   Type Rectangle
   Main
      Case message of
      SingleClic :
      Begin
      End
End

Widget 3
Property
   Position 22 80
   Type RadioButton
   Flags NoReliefString
   Title {Use 4 Colors Scheme}
   Main
      Case message of
      SingleClic :
      Begin
         Set $Ncolors = 4
         ChangeValue 4 0
         ChangeValue 5 0
      End
End

Widget 4
Property
   Position 22 130
   Type RadioButton
   Flags NoReliefString
   Title {Use 8 Colors Scheme}
   Main
      Case message of
      SingleClic :
      Begin
         Set $Ncolors = 8
         ChangeValue 3 0
         ChangeValue 5 0
      End
End

Widget 5
Property
   Position 22 180
   Type RadioButton
   Flags NoReliefString
   Title {Default            }
   Main
      Case message of
      SingleClic :
      Begin
         ChangeValue 3 0
         ChangeValue 4 0

         If $Ncolors == {} Then
         Begin
            Set $Ncolors = 8
         End
      End
End

Widget 6
Property
   Size 270 0
   Position 4 240
   Type Rectangle
Main
   Case message of
      SingleClic :
         Begin
         End
End

Widget 7
Property
   Size 60 20
   Position 16 254
   Type PushButton
   Flags NoReliefString
   Title { OK }
   Main
      Case message of
      SingleClic :
      Begin
         Do {SendToModule ColorMgr SendString 18 1 } $Ncolors
         Quit
      End
End

Widget 8
Property
   Size 60 20
   Position 110 254
   Type PushButton
   Flags NoReliefString
   Title {Cancel}
   Main
      Case message of
      SingleClic :
      Begin
         SendSignal 8 1
      End
      1 :
      Begin
         Quit
      End
End

Widget 9
Property
   Size 60 20
   Position 204 254
   Type PushButton
   Flags NoReliefString
   Title {Help}
   Main
      Case message of
      SingleClic :
      Begin
         SendSignal 9 1
      End
      1 :
      Begin
         Do {f_DisplayURL "Color Style Manager" $[NSCDE_ROOT]/share/doc/html/NsCDE-NColorsDialog.html}
      End
End

