summaryrefslogtreecommitdiffstats
path: root/ksirc/puke/palistbox.pm
diff options
context:
space:
mode:
Diffstat (limited to 'ksirc/puke/palistbox.pm')
-rw-r--r--ksirc/puke/palistbox.pm117
1 files changed, 117 insertions, 0 deletions
diff --git a/ksirc/puke/palistbox.pm b/ksirc/puke/palistbox.pm
new file mode 100644
index 00000000..e1dcb691
--- /dev/null
+++ b/ksirc/puke/palistbox.pm
@@ -0,0 +1,117 @@
+
+&::PukeSendMessage($::PUKE_WIDGET_LOAD,
+ $::PUKE_CONTROLLER,
+ $::PWIDGET_ALISTBOX,
+ "palistbox.so",
+ sub { my %ARG = %{shift()};
+ if($ARG{'iArg'} == 1){
+ print "*E* PAListBox Load failed!\n";
+ }
+ }
+ );
+
+
+package PAListBox;
+@ISA = qw(PListBox);
+use strict;
+
+if($PListBox::usage == undef){
+ $PListBox::usage = 0;
+}
+
+sub new {
+ my $class = shift;
+ my $self = $class->SUPER::new($class, @_);
+
+ $self->{widgetType} = $::PWIDGET_ALISTBOX;
+
+ if($class eq 'PAListBox'){
+ $self->create();
+ }
+
+ $self->installHandler($::PUKE_LISTBOX_SELECTED_ACK, sub{$self->selected(@_)});
+
+ return $self;
+
+}
+
+sub DESTROY {
+ my $self = shift;
+ $self->SUPER::DESTROY(@_);
+ $PAListBox::usage--;
+ if($PAListBox::usage == 0){
+ &::PukeSendMessage($::PUKE_WIDGET_UNLOAD,
+ 0,
+ $::PWIDGET_ALISTBOX,
+ "",
+ sub {}
+ );
+
+ }
+}
+
+sub inSort {
+ my $self = shift;
+ my $text = shift;
+ my $top = shift;
+
+ $self->sendMessage('iCommand' => $::PUKE_LISTBOX_INSERT_SORT,
+ 'cArg' => $text,
+ 'iArg' => $text >= 1 ? 1 : 0,
+ 'CallBack' => sub {});
+
+}
+
+sub isTop {
+ my $self = shift;
+ my $text = shift;
+
+ my %ret = $self->sendMessage('iCommand' => $::PUKE_ALISTBOX_ISTOP,
+ 'cArg' => $text,
+ 'CallBack' => sub {});
+
+ return $ret{'iArg'};
+
+}
+
+sub findNick {
+ my $self = shift;
+ my $text = shift;
+
+ my %ret = $self->sendMessage('iCommand' => $::PUKE_ALISTBOX_FIND_NICK,
+ 'cArg' => $text,
+ 'CallBack' => sub {},
+ 'WaitFor' => 1);
+
+ return $ret{'iArg'};
+
+}
+
+sub smallHighligh {
+ my $self = shift;
+ my $text = shift;
+ my $highlight = shift;
+
+ $self->sendMessage('iCommand' => $::PUKE_ALISTBOX_SMALL_HIGHLIGHT,
+ 'cArg' => $text,
+ 'iArg' => $highlight,
+ 'CallBack' => sub {});
+
+}
+
+sub bigHighligh {
+ my $self = shift;
+ my $text = shift;
+ my $highlight = shift;
+
+ $self->sendMessage('iCommand' => $::PUKE_ALISTBOX_BIG_HIGHLIGHT,
+ 'cArg' => $text,
+ 'iArg' => $highlight,
+ 'CallBack' => sub {});
+
+}
+
+
+package main;
+
+1;