Navigation:  Classes > bBrowser >

bBrowser:SetInfo()

Print this Topic    Previous pageReturn to chapter overviewNext page

Purpose

Sets for a certain state of the bBrowser a text, icon, bitmap or bCompoundValue as info an value.

Class

bBrowser

Type

Method

Syntax

<oBrowser>:SetInfo(

<iInfoState>,

<uInfo>

) Æ lSuccess

Arguments

<iInfoState>The state for which an info value is to be set. The following table lists the supported states:

 

State

Description

BINFO_INREADPROCESS

The bBrowser reads data about a slow connection.

BINFO_NORECORDS

The data server that is linked to the browser does not contain records. This state also arises, for example, if a filter or selective relation hides all records.

BINFO_NOSERVER

The browser is not linked to a data server.

BINFO_SERVERNOTUSED

The data server that is linked with the browser is not opened.

Data Type:Integer

 

<uInfo>The info value that is to be set for the chosen state.
Data Type:String | Icon | Bitmap | bCompundValue

Return Value

lSuccessA logical value that indicates whether the info value could be set.
TRUEThe info value could be set.
FALSEThe info value could not be set.
Data Type:Logic

Description

In the bBrowser there are several states in which the bBrowser cannot show data. Such a state can occur for example if in the linked data server a filter condition is set for which no records exists. In this case an info value as text, icon, bitmap or bCompoundValue can be shown in the bBrowser.

 

InfoText

 

If a string is passed for the state BINFO_INREADPROCESS, then the following variables can be used in the string:

 

Variable

Description

%RecCount%

The variable is replaced with the value from the access bInfoInReadProcess:RecCount.

%RecPos%

The variable is replaced with the value from the access bInfoInReadProcess:RecPos.

 

The variables are replaced automatically with the corresponding values when reading data. A progress bar can hereby be implemented when reading data. In this case in addition to the info value an object of class bInfoInReadProcess must be set with the method bBrowser:SetInfoData(). Among other things the object defines the interval in which the progress bar is updated. If this object is not set then there is no progress bar.

 

InfoText2

 

With the access bBrowser:InfoView the view of the info value can be formatted. For example it can define fonts, foreground and background colors.

 

So that the set info value is also shown in the browser it must be redrawn with the method bBrowser:Redraw().

Samples

In the following sample for all supported states the info values are set.

 

// open data server

odbsCUSTOMER := DBServer{"CUSTOMER"}

IF odbsCUSTOMER:Used

 // create browser

 oBrowser := bBrowser{oOwner,;

                                                 1000,;

                                                 Point{0, 0},;

                                                 Dimension{300, 250}}

 

         // set view style for info values

 oBrowser:InfoView:Grid := bGrid{BGRID_NONE, 4, 8, 4, 8}

 oBrowser:InfoView:Foreground := Color{COLORWHITE}

 oBrowser:InfoView:Background := Brush{Color{COLORBLUE}}

 

 // set text as info values

 oBrowser:SetInfo(BINFO_NOSERVER, "No server is set.")

 oBrowser:SetInfo(BINFO_SERVERNOTUSED, "Server is not open.")

 oBrowser:SetInfo(BINFO_NORECORDS, "There are no records in the choice.")

 

 oBrowser:SetInfo(BINFO_INREADPROCESS, "Data are loading. Please wait..." + CRLF + "Loading Record %RecPos% from %RecCount%")

 oInfoInReadProcess := bInfoInReadProcess{300, True}

 oBrowser:SetInfoData(BINFO_INREADPROCESS, oInfoInReadProcess)

 

         // link data server to browser and show browser

 oBrowser:Use(odbsCUSTOMER)

 oBrowser:Show()

ENDIF

See Also

bBrowser:DrawInfo()

bBrowser:GetInfo()

bBrowser:InfoView

bBrowser:IsInfoVisible()

bBrowser:SetInfoData()

bBrowser:SetInfoHeight()

bBrowser:SetInfoView()

bInfoInReadProcess

 


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