[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[6289] addons/1.3/wxPOS/WXPOS/UI/Controls/ InvoiceEntry



Revision: 6289
          http://sourceforge.net/p/ledger-smb/code/6289
Author:   einhverfr
Date:     2013-11-15 07:45:33 +0000 (Fri, 15 Nov 2013)
Log Message:
-----------
Initial autocomplete widgets

Modified Paths:
--------------
    addons/1.3/wxPOS/WXPOS/UI/Controls/InvoiceEntry/CompletePDesc.pm
    addons/1.3/wxPOS/WXPOS/UI/Controls/InvoiceEntry/CompletePNumber.pm

Modified: addons/1.3/wxPOS/WXPOS/UI/Controls/InvoiceEntry/CompletePDesc.pm
===================================================================
--- addons/1.3/wxPOS/WXPOS/UI/Controls/InvoiceEntry/CompletePDesc.pm	2013-11-15 06:45:51 UTC (rev 6288)
+++ addons/1.3/wxPOS/WXPOS/UI/Controls/InvoiceEntry/CompletePDesc.pm	2013-11-15 07:45:33 UTC (rev 6289)
@@ -0,0 +1,48 @@
+=head1 NAME
+
+WXPOS::UI::InvoiceEntry::CompletePDesc - Part Description completer
+
+=head1 SYNOPSIS
+
+   my $autcompleter = WXPOS::UI::InvoiceEntry::CompletePDesc->new();
+
+Then you can attach it to a simple autocompleter.
+
+=cut
+
+package WXPOS::UI::InvoiceEntry::CompletePDesc;
+use WX;
+use base 'WX::wxTextCompleterSimple';
+use WXPOS::State;
+use strict;
+use warnings;
+
+=head1 AUTOCOMPLETE LOGIC
+
+=head2 GetCompletions($string, $resource)
+
+This takes the list of partnumbers and pushes onto the stack those which 
+meet the prefix search.
+
+=cut
+
+sub GetCompletions{
+    my ($self, $string, $resource) = @_;
+    my @partslist = @WXPOS::State::Parts;
+    for my $part (grep {$_->{description} =~ /$string/} @partslist){
+        $resource->push_back($part->{description});
+    }
+}
+    
+
+=head1 COPYRIGHT
+
+Copyright (C) 2013 The LedgerSMB Core Team
+
+This file may be used under the terms of the GNU General Public License version
+2 or at your option any later version.  Please see the enclosed LICENSE.TXT file
+for details.
+
+=cut
+
+1;

Modified: addons/1.3/wxPOS/WXPOS/UI/Controls/InvoiceEntry/CompletePNumber.pm
===================================================================
--- addons/1.3/wxPOS/WXPOS/UI/Controls/InvoiceEntry/CompletePNumber.pm	2013-11-15 06:45:51 UTC (rev 6288)
+++ addons/1.3/wxPOS/WXPOS/UI/Controls/InvoiceEntry/CompletePNumber.pm	2013-11-15 07:45:33 UTC (rev 6289)
@@ -0,0 +1,48 @@
+=head1 NAME
+
+WXPOS::UI::InvoiceEntry::CompletePNumber - Partnumber completer
+
+=head1 SYNOPSIS
+
+   my $autcompleter = WXPOS::UI::InvoiceEntry::CompletePNumber->new();
+
+Then you can attach it to a simple autocompleter.
+
+=cut
+
+package WXPOS::UI::InvoiceEntry::CompletePNumber;
+use WX;
+use base 'WX::wxTextCompleterSimple';
+use WXPOS::State;
+use strict;
+use warnings;
+
+=head1 AUTOCOMPLETE LOGIC
+
+=head2 GetCompletions($string, $resource)
+
+This takes the list of partnumbers and pushes onto the stack those which 
+meet the prefix search.
+
+=cut
+
+sub GetCompletions{
+    my ($self, $string, $resource) = @_;
+    my @partslist = @WXPOS::State::Parts;
+    for my $part (grep {$_->{partnumber} =~ /^$string/} @partslist){
+        $resource->push_back($part->{partnumber});
+    }
+}
+    
+
+=head1 COPYRIGHT
+
+Copyright (C) 2013 The LedgerSMB Core Team
+
+This file may be used under the terms of the GNU General Public License version
+2 or at your option any later version.  Please see the enclosed LICENSE.TXT file
+for details.
+
+=cut
+
+1;

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits