PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WINDEV 24 → WX - Exemplo de Autocomplete
WX - Exemplo de Autocomplete
Iniciado por BOLLER, dez., 06 2019 1:44 PM - 4 respostas
Membro registado
3.081 mensagems
Popularité : +89 (91 votes)
Publicado em dezembro, 06 2019 - 1:44 PM
Exemplo de Autocomplete

CODIGO DA JANELA

PROCEDURE WIN_AssistedInput_Functions()

CONSTANT
IDCloseChrono = 1
END

// Array that contains all the countries
garrArrCountry is array of strings


Código do campo de texto

evento: Whenever modify // Sempre que modificar

sText is string
nPosition is int

// Deletes the previous entries
AssistedInputDeleteAll(MySelf)

// Browses the array entries
FOR ALL ELEMENT sACountry OF garrArrCountry

// If the country contains the input
IF sACountry [~] MySelf THEN

// Formats the text
sText = sACountry
nPosition = Position(sText, MySelf, 1, IgnoreCase)

// Formats the text to highlight the sought term
sText = sText[[ TO nPosition-1]] + gFontBold(True) + gPen(LightRed) + sText[[nPosition TO nPosition+Length(MySelf)-1]] + gPen(Black) + gFontBold(False)+ sText[[nPosition+Length(MySelf) TO ]]

// Adds the country
AssistedInputAdd(MySelf, sText)

END

END

// Opens the assisted input on the control
AssistedInputOpen(MySelf)







EXEMPLO CONSTA EM:

" UNIT EXAMPLES "

--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Mensagem modificada, dezembro, 06 2019 - 1:46 PM
Membro registado
3.081 mensagems
Popularité : +89 (91 votes)
Publicado em dezembro, 06 2019 - 1:45 PM
PROCEDURE __FillCountries()

sCountryList is string = [
Andorra
United Arab Emirates
Afghanistan
Antigua-AND-Barbuda
Albania
Armenia
Angola
Argentina
Austria
Australia
Azerbaijan
Bosnia-Herzegovina
Barbados
Bangladesh
Belgium
Burkina-Faso
Bulgaria
Bahrain
Burundi
Benin
Brunei
Bolivia
Brazil
Bahamas
Bhutan
Botswana
Belarus
Belize
Canada
Dem. Rep. of Congo
Central African Republic
Congo
Switzerland
Ivory Coast
Chile
Cameroon
China
Colombia
Costa Rica
Cuba
Cape Verde
Cyprus
Czech Republic
Germany
Djibouti
Denmark
Dominica
Dominican Republic
Algeria
Ecuador
Estonia
Egypt
Eritrea
Spain
Ethiopia
Finland
Fiji
Micronesia
France
Gabon
United Kingdom
Grenada
Georgia
Ghana
Gambia
Guinea
Equatorial Guinea
Greece
Guatemala
Guinea-Bissau
Guyana
Honduras
Croatia
Haiti
Hungary
Indonesia
Ireland
Israel
India
Iraq
Iran
Iceland
Italy
Jamaica
Jordan
Japan
Kenya
Kyrgyzstan
Cambodia
Kiribati
Comoros
St-Christopher-AND-Nieves
North Korea
South Korea
Kuwait
Kazakhstan
Laos
Lebanon
St-Lucia
Liechtenstein
Sri Lanka
Liberia
Lesotho
Lithuania
Luxembourg
Latvia
Libya
Morocco
Monaco
Moldavia
Madagascar
Marshall
Macedonia
Mali
Burma
Mongolia
(the)
Malta
Mauritius
Maldives
Malawi
Mexico
Malaysia
Mozambique
Namibia
Niger
Nigeria
Nicaragua
Netherlands
Norway
Nepal
Nauru
New Zealand
Oman
Panama
Peru
Papua-New-Guinea
Philippines
Pakistan
Poland
Portugal
Palaos
Paraguay
Qatar
Romania
Russia
Rwanda
Saudi Arabia
Salomon
Seychelles
Sudan
Sweden
Singapore
Slovenia
Slovakia
Sierra Leone
San Marino
Senegal
Somalia
Suriname
Sao Tome-AND-Principe
Salvador
Syria
Swaziland
Chad
Togo
Thailand
Tajikistan
Turkmenistan
Tunisia
Tonga
Turkey
Trinite-AND-Tobago
Tuvalu
Tanzania
Ukraine
Uganda
United States (the)
Uruguay
Uzbekistan
Holly See (the), OR Vatican (the)
St-Vincent-AND-the Grenadines
Venezuela
Vietnam
Vanuatu
Samoa
Yemen
South Africa
Zambia
Zimbabwe
Montenegro
Porto Rico
Serbia
Timor-Leste
Netherlands Indies
Antarctica
American Samoa
Aruba
Aland, islands
Faroe, islands
Guernesey
Greenland
Guam
Isle of Man
Jersey
Caiman, islands
Northern Mariannes, islands
Montserrat
Norfolk, island
Virgin Islands of USA
]

// Converts the string into array
StringToArray(sCountryList, garrArrCountry, CR)


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Membro registado
3.081 mensagems
Popularité : +89 (91 votes)
Publicado em dezembro, 06 2019 - 1:50 PM
CloseAssistedInput USA CRONOMETRO // TIMER

PROCEDURE CloseAssistedInput()

// Closes the assisted input
AssistedInputClose(EDT_Search_3)






--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Membro registado
3.081 mensagems
Popularité : +89 (91 votes)
Publicado em dezembro, 06 2019 - 2:03 PM
Procedure StringCountAscii(Texto,Caracter)

x, qtde is int = 0

ntotal is int = Length(Texto)

LOOP(ntotal)
x++
IF Texto[[x]] = Charact(Caracter) // 34 = aspa dupla //58 = : dois pontos
qtde++
END
END

RESULT qtde


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Mensagem modificada, dezembro, 06 2019 - 2:04 PM
Membro registado
3.081 mensagems
Popularité : +89 (91 votes)
Publicado em dezembro, 12 2019 - 12:23 PM




















--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/