Navigation:  Classes > bBrowser >

bBrowser:KeyCommand

Print this Topic    Previous pageReturn to chapter overviewNext page

Purpose

A list of keyboard commands that are to be processed by keyboard input.

Class

bBrowser

Type

Access / Assign

Data Type

bKeyCommandList

Description

Additional commands can be implemented in the bBrowser by the list of the keyboard commands. For each keyboard input, the list of the keyboard commands is scanned for the pressed key. If a keyboard command exists to the key, this is executed.

 

Important note!
The list of the keyboard commands is scanned before the standard keys of bBrowser are executed. Thereby it is possible to overlay the keyboard commands with the standard keys of bBrowser.

Samples

In the following sample two keyboard commands are defined for deleting (Ctrl+Del) and for appending (Ctrl+Ins) records.

 

METHOD PostInit() CLASS myDataWindow

 LOCAL odbsCUSTOMER AS DBServer

 LOCAL oKeyCommand  AS bKeyCommand

 

 // create browser

 odbsCUSTOMER := DBServer{"CUSTOMER"}

 

 SELF:oBrowser := bBrowser{oOwner,;

                                                         1000,;

                                                         Point{0, 0},;

                                                         Dimension{300, 250}}

 SELF:oBrowser:Use(odbsCUSTOMER)

 SELF:oBrowser:Show()

 

         // key command: Delete

 oKeyCommand := bKeyCommand{KeyDelete,;

                                                         ,;

                                                         TRUE,;

                                                         ,;

                                                         ,;

                                                         SELF,;

                                                         #RecordDelete)

 SELF:oBrowser:KeyCommand:Add(oKeyCommand)

 

         // key command: Append

 oKeyCommand := bKeyCommand{KeyInsert,;

                                                         ,;

                                                         TRUE,;

                                                         ,;

                                                         ,;

                                                         SELF,;

                                                         #RecordAppend)

 SELF:oBrowser:KeyCommand:Add(oKeyCommand)

 

METHOD RecordDelete() CLASS myDataWindow

 IF !EMPTY(SELF:oBrowser) .and. SELF:oBrowser:Used

         SELF:oBrowser:Delete()

 ENDIF

 

METHOD RecordAppend() CLASS myDataWindow

 IF !EMPTY(SELF:oBrowser) .and. SELF:oBrowser:Used

         SELF:oBrowser:Append()

 ENDIF

See Also

bKeyCommand

bKeyCommandList

 


Page url: http://www.YOURSERVER.com/index.html?bbrowser_keycommand.htm