<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/perl

use Curses;
use Curses::Widgets qw( :all );
use Curses::Forms;


my ($mwh, $dwh);
my ($text, $content);
my (@date_disp);
my (@buttons, $sel, %list);

$mwh = new Curses;
noecho();
halfdelay(5);
$mwh-&gt;keypad(1);

$mwh-&gt;erase();

$mwh-&gt;box(ACS_VLINE, ACS_HLINE);
$mwh-&gt;attrset(0);

$mwh-&gt;standout();
$mwh-&gt;addstr(0, 1, "RCMS Demo v0.0.1");
$mwh-&gt;standend();
select_colour($mwh, 'blue');



$form = Curses::Forms-&gt;new(
{
'Y' =&gt; 0,
'X' =&gt; 0,
'LINES' =&gt; $LINES,
'COLS' =&gt; $COLS
});

$form-&gt;set_defaults( 
	BORDER =&gt; 1,
	DEF_ACTV =&gt; 'green',
	DEF_INACTV =&gt; 'green',
	DEF_FUNC =&gt; \&amp;clock,
	BORDER_COLOUR =&gt; 'green',
	TITLE=&gt;'RCMS ROReport Demo v0.1'
	);

$listformat = " @&lt;&lt;&lt;&lt;  @&gt;&gt;&gt;&gt;&gt;&gt; @&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;  @&gt;&gt;&gt;&gt; @|| @&lt;&lt;&lt;&lt; £@&lt;&lt;&lt;&lt;&lt;  £@&gt;&gt;&gt;&gt;&gt;";

%list = ();

$str= formline $listformat,(1800,"00.001","Ben Jones",20,"W",12,0.60,-20.20);
$list{1}=$^A;
$^A="";

$str= formline $listformat,(1830,"00.003","John Keeney",20,"LM",12,0.80,20.0);
$list{2}=$^A;
$^A="";

%ROs=(
'1' =&gt; 'Mark Dennehy',
'2' =&gt; 'Jason Sibley',
'3' =&gt; 'David Gallagher (TRO)'
);

$Ammo="Discipline : Free Rifle

            W     LM
Brought   [200] [200]
Used      [ 20] [ 20]
Remaining [480] [480]";

$Money=
"Float at Start  : £10.00
Cashbox Total   : £11.40
Float Left      : £10.00
Net Income      :  £1.40";

$notes = "This is a demo. Nothing should work right.
And the data is not even in the database, 
let alone being recovered from it.";

$ActiveRO = "Mark Dennehy 00.002";

$form-&gt;add( 
	{ 
	'type' =&gt; 'txt_field',
	'name' =&gt; 'active_ro',
	'ypos' =&gt; 1,
	'xpos' =&gt; ($COLS /3)*2,
	'regex' =&gt; "\tqQ",
	'lines' =&gt; 1,
	'cols' =&gt; (($COLS - 2)/3)-2,
	'title' =&gt; 'Active Range Officer',
	'content' =&gt; $ActiveRO,
	'edit' =&gt; 0 
	},
	{ 
	'type' =&gt; 'list_box',
	'name' =&gt; 'ROs_On_Duty',
	'ypos' =&gt; 4,
	'xpos' =&gt; ($COLS /3)*2,
	'regex' =&gt; "\tqQ",
	'lines' =&gt; 6,
	'cols' =&gt; (($COLS - 2)/3)-2,
	'title' =&gt; 'Range Officers on Duty',
	'list' =&gt; \%ROs,
	'edit' =&gt; 0 
	},
	{ 
	'type' =&gt; 'txt_field',
	'name' =&gt; 'Ammo',
	'ypos' =&gt; 1,
	'xpos' =&gt; 1+($COLS - 2)/3,
	'regex' =&gt; "\tqQ",
	'lines' =&gt; 9,
	'cols' =&gt; (($COLS - 2)/3)-2,
	'title' =&gt; 'Ammo',
	'content' =&gt; $Ammo,
	'edit' =&gt; 0 
	},
	{ 
	'type' =&gt; 'txt_field',
	'name' =&gt; 'Money',
	'ypos' =&gt; 1,
	'xpos' =&gt; 1,
	'regex' =&gt; "\tqQ",
	'lines' =&gt; 9,
	'cols' =&gt; (($COLS - 2)/3)-2,
	'title' =&gt; 'Money',
	'content' =&gt; $Money,
	'edit' =&gt; 0 
	},
	{ 
	'type' =&gt; 'list_box',
	'name' =&gt; 'details',
	'ypos' =&gt; 12,
	'xpos' =&gt; 1,
	'lines' =&gt; $LINES - 22,
	'cols' =&gt; $COLS - 4,
	'list'	=&gt; \%list,
	'title' =&gt; 'Details'
	},
	{ 
	'type' =&gt; 'txt_field',
	'name' =&gt; 'notes',
	'ypos' =&gt; $LINES - 8,
	'xpos' =&gt; 1,
	'regex' =&gt; "\tqQ",
	'lines' =&gt; 5,
	'cols' =&gt; $COLS - 4,
	'title' =&gt; 'Notes',
	'content' =&gt; $notes,
	'edit' =&gt; 1 
	}
	);

$form-&gt;bind(
["details","[qQ]","Quit_form"],
["notes","[qQ]","Quit_form"],
);

$form-&gt;tab_order(qw( details notes ));

clock;


$form-&gt;activate(1);

clock;

msg_box(
'title' =&gt; "RCMS Demo v0.0.1",
'message' =&gt; $notes,
'border' =&gt; 'red'
);

clock;
$form-&gt;activate;


#######################################################################

sub clock {
	# Update the clock in the upper right hand corner of the screen
	#
	# Usage:  clock()

	$mwh-&gt;standout();
	$mwh-&gt;addstr(0, ($COLS - 26), scalar (localtime));
	$mwh-&gt;standend();
	$mwh-&gt;refresh();
	#Curses::Forms-&gt;refresh_forms();
}
</pre></body></html>