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

UseGettext {$NSCDE_ROOT/share/locale;NsCDE-BackdropMgr}
WindowLocaleTitle { Choose a Palette }
WindowSize 280 300
Colorset 22

Init
Begin
   Set $Palettes = (GetOutput {$NSCDE_TOOLSDIR/colormgr -p} 1 -1)
   ChangeTitle 3 $Palettes

   Set $DefaultFont = (GetOutput {$NSCDE_TOOLSDIR/getfont -v -t normal -s medium -Z 14} 1 -1)
   ChangeFont 3 $DefaultFont

   Set $BtnFont = (GetOutput {$NSCDE_TOOLSDIR/getfont -v -t normal -s medium -Z 11.5} 1 -1)
   ChangeFont 2 $BtnFont
   ChangeFont 5 $BtnFont
   ChangeFont 6 $BtnFont
   ChangeFont 7 $BtnFont

   ChangeFont 2 $DefaultFont
   # Keybindings
   Key Escape A 6 1 {KeyClose}
   Key Return C 5 1 {KeyOk}
   Key F1 A 7 1 {KeyHelp}
   Key Help A 7 1 {KeyHelp}

   ChangeLocaleTitle 2 { Default }
End

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

Widget 2
Property
   Position 164 20
   Type RadioButton
   Flags NoReliefString
   Title {   Default     }
   Font "xft:::pixelsize=15"
   Main
      Case message of
      SingleClic :
      Begin
         ChangeValue 3 0
         Set $Palette = {DEFAULT}
      End
End

Widget 3
   Property
   Position 10 50
   Size 260 182
   Type List
   Flags NoReliefString
   Colorset 20
   Flags NoReliefString
   Title {}
   Font "xft:::pixelsize=15"
   Main
      Case message of
      SingleClic :
      Begin
         Set $PaletteCmd = {$NSCDE_TOOLSDIR/colormgr -n } (GetValue 3)
         Set $Palette = (GetOutput $PaletteCmd 1 -1)
      End
End

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

Widget 5
Property
   Size 60 20
   Position 16 258
   Type PushButton
   Flags NoReliefString
   LocaleTitle {OK}
   Font "xft:::pixelsize=15"
   Main
      Case message of
      SingleClic :
      Begin
         SendSignal 5 1
      End
      1 :
      Begin
         Do {SendToModule BackdropMgr SendString 10 2 } $Palette
         Quit
      End
End

Widget 6
Property
   Size 80 20
   Position 100 258
   Type PushButton
   Flags NoReliefString
   LocaleTitle {Cancel}
   Font "xft:::pixelsize=15"
   Main
      Case message of
      SingleClic :
      Begin
         SendSignal 6 1
      End
      1 :
      Begin
         Quit
      End
End

Widget 7
Property
   Size 60 20
   Position 204 258
   Type PushButton
   Flags NoReliefString
   LocaleTitle {Help}
   Font "xft:::pixelsize=15"
   Main
      Case message of
      SingleClic :
      Begin
         SendSignal 7 1
      End
      1 :
      Begin
         Do {f_DisplayURL "$[gt.Backdrop Style Manager]" html/NsCDE-BackdropMgr.html}
      End
End

