Auto-completion for Text controls

Creative ideas/suggestions for HMG

Moderator: Rathinagiri

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Auto-completion for Text controls

Post by Pablo César »

bpd2000 wrote:What is class
Hi Dave, thank you for your interest.

What I know CLASSES are made in OOP (Object Oriented Programming) and I really do not know many about OOP neither in Harbour.
In HMG you will not find many CLASSES, basically you will find some examples in MySQL connectivity and:
  • C:\hmg.3.3.1\SOURCE\h_tole.prg (TOLEAUTO)
    C:\hmg.3.3.1\SOURCE\hbvpdf\hbvpdft.prg (tPdf)
    C:\hmg.3.3.1\SOURCE\Report\H_REPORT.PRG (_HMG_REPORT)
    C:\hmg.3.3.1\SOURCE\Report\TPRINT.PRG (TPRINT)

    C:\hmg.3.3.1\SAMPLES\HFCL\SQL\MySQL\MYSQL_3\demo.prg (TMySQLServer)
But you can see hereunder some concepts (my favorite is from Alexander Kresin).

According "Harbour guide" (FiveTechSoft):

Harbour Extensions

Language extensions - Description:
  • Class generation and management.
    CA-Cl*pper only allowed creation of objects from a few standard classes.
    In Harbour, you can create your own classes--complete with Methods, Instance Variables, Class Variables and Inheritance. Entire applications can be designed and coded in Object Oriented style.
  • @<FunctionName>()
    Returns the pointer (address) to a function.
    The returned value is not useful to application-level programming, but is used at a low level to implement object oriented coding. (Internally, a class method is a static function and there is no symbol for it, so it is accessed via its address).
  • Class HBGetList
    Object oriented support for GetLists management.
  • ProcName() support for class Method names.
    Class Methods can be retrieved from the call stack.
CLASS - Definition:

Define a Class for Object Oriented Programming

Syntax
[CREATE] CLASS <ClassName> [ <FROM, INHERIT> <SuperClass1> [, <SuperClassN>] ] [STATIC]
Argument(s)
<ClassName> Name of the class to define. By tradition, Harbour
classes start with "T" to avoid collisions with user- created classes.
<SuperClass1...n> The Parent class(es) to use for inheritance.
Harbour supports Multiple Inheritance.
STATIC This clause causes the class function to be declared
as a static function. It will therefore not be available outside the current module.
Description
CLASS creates a class from which you can create objects. The CLASS command begins the class specification, in which the DATA elements (also known as instance variables) and METHODS of the class are named. The following scoping commands may also appear. They control the default scope of DATA and METHOD commands that follow them.
<fixed>
EXPORTED: VISIBLE: HIDDEN: PROTECTED:
</fixed> The class specification ends with the END CLASS command.
Classes can inherit from multiple <SuperClasses>, and the chain of inheritance can extend to many levels.
A program uses a Class by calling the Class Constructor, usually the New() method, to create an object. That object is usually assigned to a variable, which is used to access the DATA elements and methods.

Harbour's OOP syntax and implementation supports Scoping (Protect, Hidden and Readonly) and Delegating, and is largely compatible with Class(y)(tm), TopClass(tm) and Visual Objects(tm).
Example(s)

CLASS TBColumn
DATA Block // Code block to retrieve data for the column
DATA Cargo // User-definable variable
DATA ColorBlock // Code block that determines color of data items
DATA ColSep // Column separator character
DATA DefColor // Array of numeric indexes into the color table
DATA Footing // Column footing
DATA FootSep // Footing separator character
DATA Heading // Column heading
DATA HeadSep // Heading separator character
DATA Width // Column display width
DATA ColPos // Temporary column position on screen
METHOD New() // Constructor
ENDCLASS

According "Harbour Reference Guide" (Giovanni Di Maria):

HBCLASS

According "Harbour for beginners" (Alexander Kresin):

3.3 Classes and objects

There is also this topic from our maestro Roberto Lopez which explain about OOP in HMG.
bpd2000 wrote:... why it is not in HMG
Why this kind of class (TAutoGet) is not already in HMG (is this your question and mean ?)

I do not know, probably we have to promote for having at HMG. Maybe do not need to be as OOP and been as simple function ? I do not know.
Probably HMG Development Team would response this question :?:

My wish, I have already posted. :)
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Re: Auto-completion for Text controls

Post by bpd2000 »

Thank you Pablo for more information and tip
BPD
Convert Dream into Reality through HMG
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Auto-completion for Text controls

Post by Pablo César »

bpd2000 wrote:Thank you Pablo for more information and tip
You're always very good welcome ! :)
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Auto-completion for Text controls

Post by Pablo César »

Adding Autocomplete Functionality to Your Application.

MSDN - Using Autocomplete for edit control into complete strings.
For example, when a user starts to enter a URL in the Address edit control that is embedded in the Windows Internet Explorer toolbar, autocompletion expands the string into one or more complete URL options that are consistent with the existing partial string. A partial URL string such as "mic" might be expanded to "http://www.microsoft.com" or "http://www.microsoft.com/windows". Autocompletion is typically used with edit controls or with controls that have an embedded edit control, such as the ComboBoxEx control.
https://msdn.microsoft.com/en-us/librar ... s.85).aspx

More examples:
http://www.codeproject.com/Articles/736 ... it-Control
http://www.codeproject.com/Articles/260 ... toComplete

Image
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Auto-completion for Text controls

Post by Rathinagiri »

Thank you Pablo. Let us try this in our next version.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Re: Auto-completion for Text controls

Post by bpd2000 »

+1
BPD
Convert Dream into Reality through HMG
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Auto-completion for Text controls

Post by Pablo César »

Rathinagiri wrote:Thank you Pablo. Let us try this in our next version.
Really ? Ohhh I loved It to know !!!

Thank you Rathi !
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Post Reply