Karinha
Aquí un ejemplo para que pruebe; primero el recurso
[quote:2zt284el]
// RESOURCE SCRIPT generated by "Pelles C for Windows, version 7.00".
#include
#include
#include
LANGUAGE LANG_SPANISH,SUBLANG_SPANISH_ECUADOR
AUTOGET DIALOGEX DISCARDABLE 6, 18, 210, 142
STYLE DS_SHELLFONT|WS_POPUP|DS_MODALFRAME|DS_CONTEXTHELP|DS_3DLOOK|WS_CAPTION|WS_SYSMENU|WS_VISIBLE
CAPTION "Dialog"
FONT 8, "Tahoma", 0, 0, 1
{
CONTROL "", 101, "Edit", ES_AUTOHSCROLL|WS_BORDER|WS_TABSTOP, 12, 8, 84, 12
CONTROL "OK", IDOK, "Button", WS_TABSTOP, 160, 5, 45, 15
CONTROL "Cancel", IDCANCEL, "Button", WS_TABSTOP, 160, 23, 45, 15
}
[/quote:2zt284el]
Y el .prg sería este:
[quote:2zt284el]
#include "FiveWin.ch"
#include "AutoGet.ch"
static aCountries := {;
{"Afghanistan", 'AF'},;
{"Åland Islands", 'AX'},;
{"Albania", 'AL'},;
{"Algeria", 'DZ'},;
{"American Samoa", 'AS'},;
{"AndorrA", 'AD'},;
{"Angola", 'AO'},;
{"Anguilla", 'AI'},;
{"Antarctica", 'AQ'},;
{"Antigua and Barbuda", 'AG'},;
{"Argentina", 'AR'},;
{"Armenia", 'AM'},;
{"Aruba", 'AW'},;
{"Australia", 'AU'},;
{"Austria", 'AT'},;
{"Azerbaijan", 'AZ'},;
{"Bahamas", 'BS'},;
{"Bahrain", 'BH'},;
{"Bangladesh", 'BD'},;
{"Barbados", 'BB'},;
{"Belarus", 'BY'},;
{"Belgium", 'BE'},;
{"Belize", 'BZ'},;
{"Benin", 'BJ'},;
{"Bermuda", 'BM'},;
{"Bhutan", 'BT'},;
{"Bolivia", 'BO'},;
{"Bosnia and Herzegovina", 'BA'},;
{"Botswana", 'BW'},;
{"Bouvet Island", 'BV'},;
{"Brazil", 'BR'},;
{"British Indian Ocean Territory", 'IO'},;
{"Brunei Darussalam", 'BN'},;
{"Bulgaria", 'BG'},;
{"Burkina Faso", 'BF'},;
{"Burundi", 'BI'},;
{"Cambodia", 'KH'},;
{"Cameroon", 'CM'},;
{"Canada", 'CA'},;
{"Cape Verde", 'CV'},;
{"Cayman Islands", 'KY'},;
{"Central African Republic", 'CF'},;
{"Chad", 'TD'},;
{"Chile", 'CL'},;
{"China", 'CN'},;
{"Christmas Island", 'CX'},;
{"Cocos (Keeling) Islands", 'CC'},;
{"Colombia", 'CO'},;
{"Comoros", 'KM'},;
{"Congo", 'CG'},;
{"Congo, The Democratic Republic of the", 'CD'},;
{"Cook Islands", 'CK'},;
{"Costa Rica", 'CR'},;
{"Cote D'Ivoire", 'CI'},;
{"Croatia", 'HR'},;
{"Cuba", 'CU'},;
{"Cyprus", 'CY'},;
{"Czech Republic", 'CZ'},;
{"Denmark", 'DK'} }
Function Main()
LOCAL oDlg, oGet, cName:=Space(20), oBtn1, oBtn2
DEFINE DIALOG oDlg TITLE "Prueba del Augo-Get de FW1706" RESOURCE "AUTOGET"
REDEFINE AUTOGET oGet var cName of oDlg ID 101 ;
DATASOURCE aCountries;
FILTER ListFilter1( uDataSource, cData, Self );
COLUMN 1 ;
HEIGHTLIST 100
REDEFINE BUTTON oBtn1 OF oDlg ID 1 ACTION MsgAlert("Get 1:"+cName)
REDEFINE BUTTON oBtn2 OF oDlg ID 2 ACTION oDlg:end()
ACTIVATE DIALOG oDlg CENTERED
Return nil
//---------------------------------------------------------------------------//
// match case without case sensitive
Function ListFilter1( aList, cData, oSelf )
Local aNewList := { }
Local uItem
For each uItem in oSelf:uOrgData
If Lower( SubStr( uItem[ 1 ], 1, Len( cData ) ) ) == Lower( cData )
AAdd( aNewList, uItem )
Endif
Next
RETURN aNewList
[/quote:2zt284el]
Saludos
Fernando Espinoza A.
↧