# UserProperties.pl
#
# Displays a dialogue box allowing the user to enter details 

use strict 'vars';
use Win32::GUI;

my $frmUserProperties = new Win32::GUI::DialogBox(
      -name   => 'frmUserProperties',
      -text   => 'User Properties',
      -left   => 100,
      -top    => 100,
      -width  => 460,
      -height => 350,
);

#=============================================
# Add the standard Help, Cancel and OK buttons
#=============================================

my $btnUserPropertiesHelp = $frmUserProperties->AddButton(
      -name   => 'btnUserPropertiesHelp',
      -text   => '&Help',
      -left   => $frmUserProperties->ScaleWidth() - 92,
      -top    => $frmUserProperties->ScaleHeight() - 36,
      -width  => 80,
      -height => 24,
);

my $btnUserPropertiesCancel = $frmUserProperties->AddButton(
      -name   => 'btnUserPropertiesCancel',
      -text   => 'Cancel',
      -left   => $btnUserPropertiesHelp->Left() - 92,
      -top    => $frmUserProperties->ScaleHeight() - 36,
      -width  => 80,
      -height => 24,
);

my $btnUserPropertiesOK = $frmUserProperties->AddButton(
      -name   => 'btnUserPropertiesOK',
      -text   => 'OK',
      -left   => $btnUserPropertiesCancel->Left() - 92,
      -top    => $frmUserProperties->ScaleHeight() - 36,
      -width  => 80,
      -height => 24,
);

#=======================
# Add a TabStrip Control
#=======================

my $tbsUserProperties = $frmUserProperties->AddTabStrip(
    -name      => "tbsUserProperties",
    -left      => 12,   
    -top       => 12, 
    -width     => $frmUserProperties->ScaleWidth - 24, 
    -height    => $frmUserProperties->ScaleHeight - 56,
    -bottom    => 0,  # (0)/1
    -buttons   => 0,  # (0)/1
    -hottrack  => 0,  # (0)/1
  # -imagelist => (Win32::GUI:ImageList),
    -justify   => 0,  # (0)/1
    -multiline => 1,  # (0)/1
    -right     => 0,  # (0)/1
    -vertical  => 0,  # (0)/1
);

#==================
# Insert Tab Sheets
#==================

my $tbsUserPropertiesGeneralTab = $tbsUserProperties->InsertItem(
      -name  => "tbsUserPropertiesGeneralTab",
      -text  => "G&eneral",
);

my $tbsUserPropertiesGroupsTab  = $tbsUserProperties->InsertItem(
      -name => "tbsUserPropertiesGroupsTab",
      -text => "&Groups",
);

my $tbsUserPropertiesProfileTab = $tbsUserProperties->InsertItem(
      -name => "tbsUserPropertiesProfileTab",
      -text => "P&rofile",
);

my $tbsUserPropertiesHoursTab   = $tbsUserProperties->InsertItem(
      -name => "tbsUserPropertiesHoursTab",
      -text => "H&ours",
);

my $tbsUserPropertiesLogonToTab = $tbsUserProperties->InsertItem(
      -name => "tbsUserPropertiesLogonToTab",
      -text => "&Logon To",
);

my $tbsUserPropertiesAccountTab = $tbsUserProperties->InsertItem(
      -name => "tbsUserPropertiesAccountTab",
      -text => "&Account",
);

my $tbsUserPropertiesDialinTab  = $tbsUserProperties->InsertItem(
      -name => "tbsUserPropertiesDialinTab",
      -text => "D&ialin",
);

# Just seeing what happens when there are too many tabs to
# fit in the window:

my $tbsTabA  = $tbsUserProperties->InsertItem(
      -name => "tbsTabA",
      -text => "AAAAAAA",
);

my $tbsTabB  = $tbsUserProperties->InsertItem(
      -name => "tbsTabB",
      -text => "BBBBBBB",
);

my $tbsTabC  = $tbsUserProperties->InsertItem(
      -name => "tbsTabC",
      -text => "CCCCCCC",
);

my $tbsTabD  = $tbsUserProperties->InsertItem(
      -name => "tbsTabD",
      -text => "DDDDDDD",
);

#======================================
# Add controls to individual Tab Sheets
#======================================

my $lblUserPropertiesUsername = $tbsUserPropertiesGeneralTab->AddLabel(
      -name   => 'lblUserPropertiesUsername',
      -text   => '&Description:',
      -left   => 12,
      -top    => 49,
      -width  => 80,
      -height => 36,
);

#my $txfUserPropertiesUserName = $frmUserProperties->AddTextfield(
#      -name   => 'txfUserPropertiesUserName',
#      -text   => 'Username',
#      -left   => 84,
#      -top    => 12,
#      -width  => 286,
#      -height => 24,
#);
#
#my $lblUserPropertiesDesc = $frmUserProperties->AddLabel(
#      -name   => 'lblUserPropertiesDesc',
#      -text   => '&Description:',
#      -left   => 12,
#      -top    => 49,
#      -width  => 80,
#      -height => 36,
#);
#
#my $txfUserPropertiesDesc = $frmUserProperties->AddTextfield(
#      -name   => 'txfUserPropertiesDesc',
#      -text   => 'Group Description',
#      -left   => 84,
#      -top    => 45,
#      -width  => 286,
#      -height => 24,
#);
#
#my $lblUserPropertiesMembers = $frmUserProperties->AddLabel(
#      -name => 'lblUserPropertiesMembers',
#      -text => '&Members:',
#      -left   => 12,
#      -top    => 98,
#      -width  => 80,
#      -height => 16,
#);
#
#my $lblUserPropertiesNotMembers = $frmUserProperties->AddLabel(
#      -name => 'lblUserPropertiesNotMembers',
#      -text => '&Not Members:',
#      -left   => 282,
#      -top    => 98,
#      -width  => 80,
#      -height => 16,
#);
#
#my $lbxUserPropertiesMembers = $frmUserProperties->AddListbox(
#      -name   => 'lbxUserPropertiesMembers',
#      -left   => 12,
#      -top    => 118,
#      -width  => 160,
#      -height => 107,
#);
#
#my $btnUserPropertiesAdd = $frmUserProperties->AddButton(
#      -name   => 'btnUserPropertiesAdd',
#      -text   => '<- &Add',
#      -left   => 187,
#      -top    => 135,
#      -width  => 80,
#      -height => 24,
#);
#
#my $btnUserPropertiesRemove = $frmUserProperties->AddButton(
#      -name   => 'btnUserPropertiesRemove',
#      -text   => '&Remove ->',
#      -left   => 187,
#      -top    => 167,
#      -width  => 80,
#      -height => 24,
#);
#
#my $lbxUserPropertiesNotMembers = $frmUserProperties->AddListbox(
#      -name => 'lbxUserPropertiesNotMembers',
#      -left   => 282,
#      -top    => 118,
#      -width  => 160,
#      -height => 107,
#);

$frmUserProperties->Show();

Win32::GUI::Dialog();


#=================================
#sub btnUserPropertiesCancel_Click{
#=================================
#    &frmUserProperties_Terminate();
#};


#===============================
sub frmUserProperties_Terminate{
#===============================
    return -1;
};

sub tbsUserProperties_Click(){
    print "Stub: tbsUserProperties Tab ".$tbsUserProperties->SelectedItem()." clicked.\n";
};
