Table of Contents

KBasic 2Framework

2TODO is a todo list, with features definitely implemented as soon as possible.

form hat eigenschaft “Parentless” → als eigenständiges form in der taskleiste

FileSystemWatcher

Implemented since KBasic V1.99.

The Qt documentation in C++ of this class (QFileSystemWatcher) can be read here: http://doc.trolltech.com/4.3/qfilesystemwatcher.html

This class provides monitoring files and directories for modifications.

Methods:

Events in the event class:


FontMetrics

Implemented since KBasic V1.99.

The Qt documentation in C++ of this class (QFontMetrics) can be read here: http://doc.trolltech.com/4.3/qfontmetrics.html

Methods:


Ftp

Implemented since KBasic V1.99.

The Qt documentation in C++ of this class (QFtp) can be read here: http://doc.trolltech.com/4.3/qftp.html

Methods:


Http

Implemented since KBasic V1.99.

The Qt documentation in C++ of this class (QHttp) can be read here: http://doc.trolltech.com/4.3/qhttp.html

Methods:


TcpSockets

Implemented since KBasic V1.99.

The Qt documentation in C++ of this class (QTcpSocket) can be read here: http://doc.trolltech.com/4.3/qtcpsocket.html

Methods:

ConnectionRefusedError The connection was refused by the peer (or timed out).
RemoteHostClosedError The remote host closed the connection. Note that the client socket (i.e., this socket) will be closed after the remote close notification has been sent.
HostNotFoundError The host address was not found.
SocketAccessError The socket operation failed because the application lacked the required privileges.
SocketResourceError The local system ran out of resources (e.g., too many sockets).
SocketTimeoutError The socket operation timed out.
DatagramTooLargeError The datagram was larger than the operating system's limit (which can be as low as 8192 bytes).
NetworkError An error occurred with the network (e.g., the network cable was accidentally plugged out).
AddressInUseError The address specified to QUdpSocket::bind() is already in use and was set to be exclusive.
SocketAddressNotAvailableError The address specified to QUdpSocket::bind() does not belong to the host.
UnsupportedSocketOperationError The requested socket operation is not supported by the local operating system (e.g., lack of IPv6 support).
ProxyAuthenticationRequiredError The socket is using a proxy, and the proxy requires authentication.
SslHandshakeFailedError The SSL/TLS handshake failed, so the connection was closed (only used in QSslSocket)
UnknownSocketError An unidentified error occurred.
UnfinishedSocketOperationError Used by QAbstractSocketEngine only, The last operation attempted has not finished yet (still in progress in the background).
NullThe null address object. Equivalent to QHostAddress().
LocalHostThe IPv4 localhost address. Equivalent to QHostAddress(“127.0.0.1”).
LocalHostIPv6The IPv6 localhost address. Equivalent to QHostAddress(”::1”).
BroadcastThe IPv4 broadcast address. Equivalent to QHostAddress(“255.255.255.255”).
AnyThe IPv4 any-address. Equivalent to QHostAddress(“0.0.0.0”).
AnyIPv6The IPv6 any-address. Equivalent to QHostAddress(”::”).
NoProxyNo proxying is used
DefaultProxyProxy is determined based on the application proxy set using setApplicationProxy()
Socks5ProxySocks5 proxying is used
HttpProxyHTTP transparent proxying is used
HttpCachingProxyProxying for HTTP requests only
FtpCachingProxyProxying for FTP requests only
TcpSocketTCP
UdpSocketUDP
UnknownSocketTypeOther than TCP and UDP
UnconnectedStateThe socket is not connected.
HostLookupStateThe socket is performing a host name lookup.
ConnectingStateThe socket has started establishing a connection.
ConnectedStateA connection is established.
BoundStateThe socket is bound to an address and port (for servers).
ClosingStateThe socket is about to close (data may still be waiting to be written).
ListeningStateFor internal use only.

Events in the event class:

TcpServers

Implemented since KBasic V1.99.

The Qt documentation in C++ of this class (QTcpServer) can be read here: http://doc.trolltech.com/4.3/qtcpserver.html

Methods:

NoProxyNo proxying is used
DefaultProxyProxy is determined based on the application proxy set using setApplicationProxy()
Socks5ProxySocks5 proxying is used
HttpProxyHTTP transparent proxying is used
HttpCachingProxyProxying for HTTP requests only
FtpCachingProxyProxying for FTP requests only

Events in the event class:


Processes

Implemented since KBasic V1.99.

Functions are

StandardOutputThe standard output (stdout) of the running process.
StandardErrorThe standard error (stderr) of the running process.
FailedToStartThe process failed to start. Either the invoked program is missing, or you may have insufficient permissions to invoke the program.
CrashedThe process crashed some time after starting successfully.
TimedoutThe last waitFor…() function timed out. The state of QProcess is unchanged, and you can try calling waitFor…() again.
WriteErrorAn error occurred when attempting to write to the process. For example, the process may not be running, or it may have closed its input channel.
ReadErrorAn error occurred when attempting to read from the process. For example, the process may not be running.
UnknownErrorAn unknown error occurred. This is the default return value of error().
NormalExitThe process exited normally.
CrashExitThe process crashed.
SeparateChannelsQProcess manages the output of the running process, keeping standard output and standard error data in separate internal buffers. You can select the QProcess's current read channel by calling setReadChannel(). This is the default channel mode of QProcess.
MergedChannelsQProcess merges the output of the running process into the standard output channel (stdout). The standard error channel (stderr) will not receive any data. The standard output and standard error data of the running process are interleaved.
ForwardedChannelsQProcess forwards the output of the running process onto the main process. Anything the child process writes to its standard output and standard error will be written to the standard output and standard error of the main process.
StandardOutputThe standard output (stdout) of the running process.
StandardErrorThe standard error (stderr) of the running process.
SeparateChannelsQProcess manages the output of the running process, keeping standard output and standard error data in separate internal buffers. You can select the QProcess's current read channel by calling setReadChannel(). This is the default channel mode of QProcess.
MergedChannelsQProcess merges the output of the running process into the standard output channel (stdout). The standard error channel (stderr) will not receive any data. The standard output and standard error data of the running process are interleaved.
ForwardedChannelsQProcess forwards the output of the running process onto the main process. Anything the child process writes to its standard output and standard error will be written to the standard output and standard error of the main process.
SeparateChannelsQProcess manages the output of the running process, keeping standard output and standard error data in separate internal buffers. You can select the QProcess's current read channel by calling setReadChannel(). This is the default channel mode of QProcess.
MergedChannelsQProcess merges the output of the running process into the standard output channel (stdout). The standard error channel (stderr) will not receive any data. The standard output and standard error data of the running process are interleaved.
ForwardedChannelsQProcess forwards the output of the running process onto the main process. Anything the child process writes to its standard output and standard error will be written to the standard output and standard error of the main process.
NotOpenThe device is not open.
ReadOnlyThe device is open for reading.
WriteOnlyThe device is open for writing.
ReadWriteReadOnly and WriteOnly The device is open for reading and writing.
AppendThe device is opened in append mode, so that all data is written to the end of the file.
TruncateIf possible, the device is truncated before it is opened. All earlier contents of the device are lost.
TextWhen reading, the end-of-line terminators are translated to '\n'. When writing, the end-of-line terminators are translated to the local encoding, for example '\r\n' for Win32.
UnbufferedAny buffer in the device is bypassed.

Events in the event class:


RegExp

Implemented since KBasic V1.99.


NetworkInterface

Implemented since KBasic V1.99.


HostInfo

Implemented since KBasic V1.99.


Url

Implemented since KBasic V1.99.


Html

Implemented since KBasic V1.99.


Thread

Implemented since KBasic V1.99.

IdlePriorityscheduled only when no other threads are running.
LowestPriorityscheduled less often than LowPriority.
LowPriorityscheduled less often than NormalPriority.
NormalPrioritythe default priority of the operating system.
HighPriorityscheduled more often than NormalPriority.
HighestPriorityscheduled more often than HighPriority.
TimeCriticalPriorityscheduled as often as possible.
InheritPriorityuse the same priority as the creating thread. This is the default.

FileOpenEvent

Implemented since KBasic V1.99.

Events in the event class:


XmlStreamReader

Implemented since KBasic V1.99.


XmlStreamWriter

Implemented since KBasic V1.99.


CalenderBox

Implemented since KBasic V1.99

The Qt documentation in C++ of this class (QCalendarWidget) can be read here: http://doc.trolltech.com/4.3/qcalenderwidget.html

Please read the control class overview Control as well.

Properties are

SingleLetterDayNames, ShortDayNames, LongDayNames, NoHorizontalHeader

NoSelection, SingleSelection

ISOWeekNumbers, NoVerticalHeader

Monday, Tuesday , Wednesday, Thursday, Friday, Saturday, Sunday

Methods are

Events are


SeekSlider, VolumeSlider, (ColumnView), TableView, LCDNumberBox, (ToolView, Splitter), DoubleSpinBox, DialBox, PropertyView

Class Control

PreferenceId

ReadOnly PreferenceId As String

Indicates the value to be stored in preferences.

Event (OnPrint)

OnPrint()

It is called when your control is about to be printed in your report.

Not implemented yet.

(BoxIndex)

in future versions:

ReadOnly BoxIndex As Integer

Internally used by KBasic. (SplitIndex)

in future versions:

ReadOnly SplitIndex As Integer

Internally used by KBasic.

(BoxX)

in future versions:

ReadOnly BoxX As Integer

Internally used by KBasic. (BoxY)

in future versions:

ReadOnly BoxY As Integer

Internally used by KBasic.

QtBinding (QWidget)

Property QWidget As QWidget (ReadOnly)

Not implemented yet.

NEW CONTROLS

IntegerControl

ArrayControl, DictionaryControl, StringsControl… visuelles deklarieren von variablen in der form

RegExp (kein control sondern datatype)

((Thread

ToolButton

Inherits CommandButton

Append/Remove/RemoveAll…

ToolView

VBox

besser überall Append() nur

TextBox1, Label2, …

HBox

AppendControl

VHBox

AppendControl

Splitter

AppendControl

Orientation As String

Splitter.Vertical, Splitter.Horizontal

ScrollBar

wie slider

Orientation As String

Vertical, Horizontal

OnEvent()

Dial

SpinBox

UpDownArrows, PlusMinus, NoButtons

CorrectToPreviousValue, CorrectToNearestValue

DoubleSpinBox

wie SpinBox aber

Table

columnCount : int rowCount : int

setCellControl/cellControl as Control

column, row

removecellcontrol

select(row, column)

void insertColumn ( int column ) void insertRow ( int row ) void removeColumn ( int column ) void removeRow ( int row ) void scrollToItem ( const QTableWidgetItem * item, QAbstractItemView::ScrollHint hint = EnsureVisible )

void cellActivated ( int row, int column ) void cellChanged ( int row, int column ) void cellClicked ( int row, int column ) void cellDoubleClicked ( int row, int column ) void cellEntered ( int row, int column ) void cellPressed ( int row, int column ) void currentCellChanged ( int currentRow, int currentColumn, int previousRow, int previousColumn ) void currentItemChanged ( QTableWidgetItem * current, QTableWidgetItem * previous ) void itemActivated ( QTableWidgetItem * item ) void itemChanged ( QTableWidgetItem * item ) void itemClicked ( QTableWidgetItem * item ) void itemDoubleClicked ( QTableWidgetItem * item ) void itemEntered ( QTableWidgetItem * item ) void itemPressed ( QTableWidgetItem * item ) void itemSelectionChanged ()

Calender

minimum, maximum

goto(month, year)

month() as integer year() as integer

dateEditAcceptDelay : int dateEditEnabled : bool firstDayOfWeek : Qt::DayOfWeek gridVisible : bool horizontalHeaderFormat : HorizontalHeaderFormat

QCalendarWidget::SingleLetterDayNames 1 The header displays a single letter abbreviation for day names (e.g. M for Monday). QCalendarWidget::ShortDayNames 2 The header displays a short abbreviation for day names (e.g. Mon for Monday). QCalendarWidget::LongDayNames 3 The header displays complete day names (e.g. Monday). QCalendarWidget::NoHorizontalHeader 0 The header is hidden.

maximumDate : QDate minimumDate : QDate navigationBarVisible : bool selectedDate : QDate selectionMode : SelectionMode

QCalendarWidget::NoSelection 0 Dates cannot be selected. QCalendarWidget::SingleSelection

verticalHeaderFormat : VerticalHeaderFormat QCalendarWidget::ISOWeekNumbers 1 The header displays a ISO week numbers QDate::weekNumber(). QCalendarWidget::NoVerticalHeader

void Selected( const QDate & date ) void gotoNextMonth () void gotoNextYear () void gotoPreviousMonth () void gotoPreviousYear () void gotoSelectedDate () void gotoToday ()

OnEvent()

(void activated ( const QDate & date ) void onclicked ( const QDate & date ) void oncurrentPageChanged (int month , int year, ) void onselectionChanged ()

FontComboBox

wie ComboBox aber

LCDNumber

LCDNumber.Hex, Hex, Dec, Oct,Bin

Outline, Filled, Flat

Slider

Orientation As String

Vertical, Horizontal

NoTicks, TicksBothSides, TicksAbove, TicksBelow, TicksLeft, TicksAbove, TicksRight

 
* Tracking As Boolean
* InvertedAppearance As Boolean
* InvertedControls As Boolean

FTP

enum Command { None, SetTransferMode, SetProxy, ConnectToHost, …, RawCommand } enum Error { NoError, HostNotFound, ConnectionRefused, NotConnected, UnknownError } enum State { Unconnected, HostLookup, Connecting, Connected, LoggedIn, Closing } enum TransferMode { Passive, Active } enum TransferType { Binary, Ascii }

int cd ( const QString & dir ) void clearPendingCommands () int close () int connectToHost ( const QString & host, quint16 port = 21 )

errorString () As String

int get ( const QString & file, QIODevice * dev = 0, TransferType type = Binary ) bool hasPendingCommands () const int list ( const QString & dir = QString() ) int login ( const QString & user = QString(), const QString & password = QString() ) int mkdir ( const QString & dir ) int put ( QIODevice * dev, const QString & file, TransferType type = Binary ) int put ( const QByteArray & data, const QString & file, TransferType type = Binary ) int rawCommand ( const QString & command ) qint64 read ( char * data, qint64 maxlen ) QByteArray readAll () int remove ( const QString & file ) int rename ( const QString & oldname, const QString & newname ) int rmdir ( const QString & dir ) int setProxy ( const QString & host, quint16 port ) int setTransferMode ( TransferMode mode ) State state () const

void abort ()

void commandFinished ( int id, bool error ) void commandStarted ( int id ) void dataTransferProgress ( qint64 done, qint64 total ) void done ( bool error ) void listInfo ( const QUrlInfo & i ) void rawCommandReply ( int replyCode, const QString & detail ) void readyRead () void stateChanged ( int state )

HTTP

Error

This enum identifies the error that occurred.

Constant Value Description QHttp::NoError 0 No error occurred. QHttp::HostNotFound 2 The host name lookup failed. QHttp::ConnectionRefused 3 The server refused the connection. QHttp::UnexpectedClose 4 The server closed the connection unexpectedly. QHttp::InvalidResponseHeader 5 The server sent an invalid response header. QHttp::WrongContentLength 6 The client could not read the content correctly because an error with respect to the content length occurred. QHttp::Aborted 7 The request was aborted with abort(). QHttp::UnknownError

State

This enum is used to specify the state the client is in:

Constant Value Description QHttp::Unconnected 0 There is no connection to the host. QHttp::HostLookup 1 A host name lookup is in progress. QHttp::Connecting 2 An attempt to connect to the host is in progress. QHttp::Sending 3 The client is sending its request to the server. QHttp::Reading 4 The client's request has been sent and the client is reading the server's response. QHttp::Connected 5 The connection to the host is open, but the client is neither sending a request, nor waiting for a response. QHttp::Closing

abort(), request(), get(), post(), close(), read(), open(host, proxy, socket, user)

# int setHost ( const QString & hostName, quint16 port = 80 ) # int setProxy ( const QString & host, int port, const QString & username = QString(), const QString & password = QString() ) # int setSocket ( QTcpSocket * socket ) # int setUser ( const QString & userName, const QString & password = QString() ) #

events:

void dataReadProgress ( int done, int total )

void dataSendProgress ( int done, int total )

void done ( bool error )

void readyRead ( const QHttpResponseHeader & resp )

void requestFinished ( int id, bool error )

void requestStarted ( int id )

void responseHeaderReceived ( const QHttpResponseHeader & resp )

void stateChanged ( int state )

NetworkInterface

InterfaceFlag { IsUp, IsRunning, CanBroadcast, IsLoopBack, IsPointToPoint, CanMulticast } address as string name as string hardwareAddress as string

as string broadcast ()

as string ip ()

as string netmask ()

{}

NetworkProxy

Host

Password

Port

Type

User

{}

Application.SetProxy(Id As String/Integer)

(NetworkAddressEntry

String broadcast ()

String ip ()

String netmask ()

(Icon

Picture

besser in Box einbauen superclass von Box wird QPicture

SVG

wie image nur QSvgWidget

Pixmap

DirView

DirBox

FileBox

FontBox

ColorBox

ColorComboBox

wie combobox aber

CheckListBox

wie listbox, items sind aber alle checkable

CheckTreeView

wie treeview aber items sind checkable (parent/child einstellbar)

PropertyListView

GoToHeader(Id)

AppendHeader(Id, Name)

Append(Id, Name, Type : Boolean, String, Integer, Double, (Strings, Integers, Doubles)

Strings key/value key wird als option angezeigt

SetSpecial(Zoom, Color, File, Font, Event)

SetBoolean/String/(Id, Boolean/String/) GetBoolean/String/(Id) As Boolean/String/ SetVisible(Id, Boolean)/IsVisible(Id)

String, Integer, Double, Boolean

IconView

DOM

XML

TcpServer

Sound

UdpServer

TcpSocket

ChildControls

Hidden

Sprite

list of gif/mng filenames to show

Sub Show(String)

Property Interval As Integer

ImageButton

ImageMap

256-color image file, each color is used to fill a part of an image (world map, each contry different color used)

IndexFile As String = filename which is a 256-color file ImageFile As String = filename to a file used to display

OnColorIndex(ColorIndex As Integer, X As Integer, Y As Integer)

Highlight(ColorIndex As Integer, QColor) → draws a lighter image partly only for colorindex

SpaceBox

als platzhalter für toolbar oder statusbar

Label3d

FontColor FontFrameColor

wie painter.drawframedtext

Day

Month

Year

Week

Resizer

mit maus formgröße verändern für rechte untere ecke

User

Implemented since KBasic V1.77.

Group

Implemented since KBasic V1.77.

Processes

Implemented since KBasic V1.77.

It is useful to launch other programs.

Function Run(FileName As String) As String

Function Run(FileName As String, Arguments As Strings, Environment As Strings) As String

Function Ids() As Strings

Sub Kill(ProcessId As String)

Sub Terminate(ProcessId As String)

Function LastError(ProcessId As String) As String

Function IsCrashed(ProcessId As String) As Boolean

Function IsRunning (ProcessId As String) As Boolean

Function IsStopped (ProcessId As String) As Boolean

Function ExitCode(ProcessId As String) As Integer

Function WaitForStarted(ProcessId As String) As Boolean

Blocks until the process has started.

Function WaitForReadyRead(ProcessId As String) As Boolean

Blocks until new data is ready for reading.

Function WaitForBytesWritten(ProcessId As String) As Boolean

Function WaitForFinished(ProcessId As String) As Boolean

Function ReadText(ProcessId As String) As String

Function WriteText(ProcessId As String, Text As String) As Boolean

Function stdout(ProcessId As String) As String

Function stderr(ProcessId As String) As String

Process_OnEvent(ProcessId As String, LastError As String, stdout As String, stderr As String, Done As Boolean)

CONTROLS

Form

neue property ResizeLeft, ResizeTop, ResizeBottom, ResizeRight: mit maus form vergrößerbar

Form.DragMoveForm → mit maus fensterposition verändern

Control.ParentForm = myForm2 –> reparent möglich machen

OpacityOnLostFocus

wheelEvent wenn scrollxy gesetzt damit vertical gescrollt wird

Function Controls() As Controls

TableViewSetTabChangesFocus TableViewFixedLayout 1TableViewRowHeight TableViewGridStyle 0BorderShape TableViewShowGrid TableViewAlternatingRowColors

SQL: Cut/Copy/Paste

SetDirty LastSQLError IsAddNew Affected

(OnAfterInsert)

OnAfterUpdate()

(OnAfterDelete)

Not implemented yet. (0Form.Hwnd)

(0TableViewReadOnly)

SaveControls(String) As Boolean LoadControls(String)


CommandButton


Label


CheckBox


RadioButton


TextBox

    void clear ()
  *
    void copy () const
  *
    void cut ()
  *
    void paste ()
  *
    void redo ()
  *
    void selectAll ()
  *
    void setText ( const QString & )
  *
    void undo ()

(0ValidatorRegEx) Property ValidatorRegEx As String (ReadOnly)

Not implemented yet:

A rich Perl-like pattern matching syntax.

Can be used to check whether a piece of text meets some criteria. Regexps are built up from expressions, quantifiers, and assertions. See original Qt documentation for how to write regular expressions: http://doc.trolltech.com/4.2/qregexp.html#details


(0ValidatorRegEx2) Property ValidatorRegEx2 As String (ReadOnly)

Not implemented yet:

Like RegEx, but with greedy quantifiers. This will be the default in Qt 5.

Can be used to check whether a piece of text meets some criteria. See the original Qt documentation for more information: http://doc.trolltech.com/4.2/qregexp.html#det

(0OnReturnPressed) Not implemented yet:

Sub OnReturnPressed()


(0OnTextChanged) Not implemented yet:

Sub OnTextChanged() —–2


Frame

onevent → checked


ComboBox

(9999EntryOnly) Property EntryOnly As Boolean (ReadOnly)

Not implemented yet.

If it is true, only text of existing combobox entries might be entered.


ListBox

Not implemented yet: ListBoxFlag:

QListView::LeftToRight 0 The items are laid out in the view from the left to the right. QListView::TopToBottom

QListView::Static 0 The items cannot be moved by the user. QListView::Free 1 The items can be moved freely by the user. QListView::Snap

QListView::Fixed 0 The items will only be laid out the first time the view is shown. QListView::Adjust

QListView::ListMode 0 The items are laid out using TopToBottom flow, with Small size and Static movement QListView::IconMode 1 The items are laid out using LeftToRight flow, with Large size and Free movement


DateBox


TimeBox


DateTimeBox


Timer


Tab

select/selected as string

Sub OnEvent(Index As Integer, Selected As String)


Image


TreeView

A control providing information in a tree structure. It might be used as list view as well, because you can create lists with several columns, but the coding is the same.


ListView


Box


Editor

linewrap in ide and run

Not implemented yet:

Events:

neue befehle ähnlich zu folgenden 

zeile markiern
zeilen löschen


....

QKeySequence::HelpContents	1	Open help contents.
QKeySequence::WhatsThis	2	Activate whats this.
QKeySequence::Open	3	Open Document.
QKeySequence::Close	4	Close Document/Tab.
QKeySequence::Save	5	Save Document.
QKeySequence::New	6	Create new Document.
QKeySequence::Delete	7	Delete.
QKeySequence::Cut	8	Cut.
QKeySequence::Copy	9	Copy.
QKeySequence::Paste	10	Paste.
QKeySequence::Undo	11	Undo.
QKeySequence::Redo	12	Redo.
QKeySequence::Back	13	Navigate back.
QKeySequence::Forward	14	Navigate forward.
QKeySequence::Refresh	15	Refresh or reload current document.
QKeySequence::ZoomIn	16	Zoom in.
QKeySequence::ZoomOut	17	Zoom out.
QKeySequence::Print	18	Print document.
QKeySequence::AddTab	19	Add new tab.
QKeySequence::NextChild	20	Navigate to next tab or child window.
QKeySequence::PreviousChild	21	Navigate to previous tab or child window.
QKeySequence::Find	22	Find in document.
QKeySequence::FindNext	23	Find next result.
QKeySequence::FindPrevious	24	Find previous result.
QKeySequence::Replace	25	Find and replace.
QKeySequence::SelectAll	26	Select all text.
QKeySequence::Bold	27	Bold text.
QKeySequence::Italic	28	Italic text.
QKeySequence::Underline	29	Underline text.
QKeySequence::MoveToNextChar	30	Move cursor to next character.
QKeySequence::MoveToPreviousChar	31	Move cursor to previous character.
QKeySequence::MoveToNextWord	32	Move cursor to next word.
QKeySequence::MoveToPreviousWord	33	Move cursor to previous word.
QKeySequence::MoveToNextLine	34	Move cursor to next line.
QKeySequence::MoveToPreviousLine	35	Move cursor to previous line.
QKeySequence::MoveToNextPage	36	Move cursor to next page.
QKeySequence::MoveToPreviousPage	37	Move cursor to previous page.
QKeySequence::MoveToStartOfLine	38	Move cursor to start of line.
QKeySequence::MoveToEndOfLine	39	Move cursor to end of line.
QKeySequence::MoveToStartOfBlock	40	Move cursor to start of a block. This shortcut is only used on OS X.
QKeySequence::MoveToEndOfBlock	41	Move cursor to end of block. This shortcut is only used on the OS X.
QKeySequence::MoveToStartOfDocument	42	Move cursor to start of document.
QKeySequence::MoveToEndOfDocument	43	Move cursor to end of document.
QKeySequence::SelectNextChar	44	Extend selection to next character.
QKeySequence::SelectPreviousChar	45	Extend selection to previous character.
QKeySequence::SelectNextWord	46	Extend selection to next word.
QKeySequence::SelectPreviousWord	47	Extend selection to previous word.
QKeySequence::SelectNextLine	48	Extend selection to next line.
QKeySequence::SelectPreviousLine	49	Extend selection to previous line.
QKeySequence::SelectNextPage	50	Extend selection to next page.
QKeySequence::SelectPreviousPage	51	Extend selection to previous page.
QKeySequence::SelectStartOfLine	52	Extend selection to start of line.
QKeySequence::SelectEndOfLine	53	Extend selection to end of line.
QKeySequence::SelectStartOfBlock	54	Extend selection to the start of a text block. This shortcut is only used on OS X.
QKeySequence::SelectEndOfBlock	55	Extend selection to the end of a text block. This shortcut is only used on OS X.
QKeySequence::SelectStartOfDocument	56	Extend selection to start of document.
QKeySequence::SelectEndOfDocument	57	Extend selection to end of document.
QKeySequence::DeleteStartOfWord	58	Delete the beginning of a word up to the cursor.
QKeySequence::DeleteEndOfWord	59	Delete word from the end of the cursor.
QKeySequence::DeleteEndOfLine

Browser


ProgressBar



ToolBarItem

IconOnly Only display the icon. TextOnly Only display the text. TextBesideIcon The text appears beside the icon. TextUnderIcon


Report

Not implemented yet




SerialPort



ChildControl


OBJECTS

String


1File

METHODS

binary mode / text mode

Open

Function Open(FileName As String, Mode As String, Access As String) As Boolean

Mode = Binary, Text Access = Read, Write, Append, Truncate


(OpenForReading

Function OpenForReading(FileName As String) As Boolean


(OpenForWriting

Function OpenForWriting(FileName As String) As Boolean


(OpenForUpdating

Function OpenForUpdating(FileName As String) As Boolean


(OpenForAppending

Function OpenForAppending(FileName As String) As Boolean


(OpenForTemporary

Function OpenForTemporary(FileName As String) As Boolean


FileName

Function FileName() As String


Extension

Function Extension() As String


BaseName

Function BaseName() As String


Path

Function Path() As String


Close

Function Close() As Boolean


ReadString

Function ReadString() As String


ReadAllString

Function ReadAllString() As String


WriteString

Function WriteString(Data As String) As Boolean


(Read

Function Read() As UDFType


(Write

Function Write(UserDefinedType As UDFType) As Boolean


ReadBytes

Function ReadBytes(Len As Long) As Bytes

Sorry. Not implemented yet.


ReadAllBytes

Function ReadAllBytes(Len As Long) As Bytes

Sorry. Not implemented yet.


WriteBytes

Function WriteBytes(Bytes As ByteArray) As Boolean

Sorry. Not implemented yet.


Position

Function Position() As Long


SetPosition

Function SetPosition(NewPosition As Long) As Boolean


IsEndOfFile

Function IsEndOfFile() As Boolean


Copy

Function Copy(DestinationPath As String) As Boolean


Move

Function Move(DestinationPath As String) As Boolean


Length

Function Length() As Long


CreateTime

Function CreateTime() As DataTime


UpdateTime

Function UpdateTime() As DataTime


User

Function User() As String


Group

Function Group() As String


SetPermission

Function SetPermission(Readable As Boolean, Writeable As Boolean, Executable As Boolean) As Boolean


IsOpen

Function IsOpen() As Boolean


IsFile

Function IsFile() As Boolean


IsExecutable

Function IsExecutable() As Boolean


IsReadable

Function IsReadable() As Boolean


IsWriteable

Function IsWriteable() As Boolean


IsHidden

Function IsHidden() As Boolean


STATIC METHODS

Create

Static Function Create(Path As String) As Boolean


Remove

Static Function Remove(Path As String) As Boolean


Copy

Static Function Copy(SourcePath As String, DestinationPath As String) As Boolean


Move

Static Function Move(OldPath As String, NewPath As String) As Boolean


IsFile

Static Function IsFile(Path As String) As Boolean


Exists

Static Function Exists(Path As String) As Boolean


Truncate

Static Function Truncate(FileName As String) As Boolean


Load

Static Function Load(FileName As String) As String


Save

Static Function Save(FileName As String, Data As String) As Boolean


ReadBytes

Static Function ReadBytes(FileName As String) As ByteArray

Sorry. Not implemented yet.


WriteBytes

Static Function WriteBytes(FileName As String, Bytes As ByteArray) As Boolean

Sorry. Not implemented yet.



1DateTime

Sorry. Not implemented yet. Use instead the builtin functions: http://www.kbasic.com/doku.php?id=lrbuiltins


0Query

Sorry. Not implemented yet.

If you need to change sql records, you either create a form with controls and set the SQLName's of the controls. Open this form using OpenHidden; or use the Query class.


Event


Bytes

Implemented since KBasic V1.76.

Methods are

Array


STATIC OBJECTS

Properties:

Methods:

Static Sub Show()

Static Sub Hide()

Static Sub ToggleVisible()

Static Sub SetVisible(Boolean)

Static Sub IsVisible) As Boolean


ToolBar

The Qt documentation in C++ of this class (QToolBar) can be read here: http://doc.trolltech.com/4.3/qtoolbar.html

You may use one ToolBar object in your application only. Name your toolbar “myToolBar” in the project window's file, which you would like to have used by the compiler for building your application.

It is planned to support dynamic created menubars and toolbars at runtime.

Use the following static function of the class ToolBar to get the toolbar item of the desired toolbar.

Dim i As ToolBarItem = ToolBar.ToolBarItem("File")
i.Enabled = True

Not implemented yet:

umbennen in append/remove/insert

Property:

Methods:

IconOnly Only display the icon.
TextOnly Only display the text.
TextBesideIcon The text appears beside the icon.
TextUnderIcon

Math


StatusBar

umbennen in append/remove/insert

Sub AppendControl(Control)

RemoveControl(Control)

Static Sub InsertControl(Index As Integer, Control)

Static Sub InsertControl(Index As Integer, C


InputDialog

MessageBox

FindDialog

ReplaceDialog

FindFileDialog

qt beispiel gibt es

ReplaceFileDialog

FileOpenDialog


1FileSaveDialog

Sorry. Not implemented yet.

Methods:

AnyFile The name of a file, whether it exists or not.
ExistingFile The name of a single existing file.
Directory The name of a directory. Both files and directories are displayed.
DirectoryOnly The name of a directory. The file dialog will only display directories.
ExistingFiles The names of zero or more existing files.
ShowDirsOnly Only show directories in the file dialog. By default both files and directories are shown.
DontResolveSymlinks Don't resolve symlinks in the file dialog. By default symlinks are resolved.
DontConfirmOverwrite Don't ask for confirmation if an existing file is selected. By default confirmation is requested.
DontUseSheet Don't make the native file dialog a sheet. By default on Mac OS X, the native file dialog is made a sheet if it has a parent that can take a sheet.
DontUseNativeDialog Don't use the native file dialog. By default on Mac OS X and Windows, the native file dialog is used.
Dim filename As String = FileSaveDialog.GetFile()
If FileSaveDialog.ok() Then
  Print filename
End If

1DataBase

Sorry. Not implemented yet.

Methods:

First row contains the names of the fields. The separator is ','.

Name As Type, Name As Type, Name As Type, Name As Type, → wird von kb in sql umgesetzt

SQLITE is selected.


1Console

Sorry. Not implemented yet.

wie screen

Methods:

1Screen

Sorry. Not implemented yet.

Methods:


1Preferences

Sorry. Not implemented yet.

wird automatisch als ini-datei gespeichert.

Preference jedes control, wenn gesetzt wird OnChange() preference gespeichert DefaultValue jedes control

Methods:


SystemTray

DragDrop

Implemented since KBasic V1.75.

Property:

Methods:


Clipboard

Implemented since KBasic V1.75.

Property:


Application

Not implemented yet:

detailed description about

QSysInfo::BigEndian QSysInfo::LittleEndian

32 or 64

Static Sub SetDefaultSound(String) played if no soundonevent has been set on controls

hide, show, visible

screenwidth, screenheight → desktopwidth, desktopheight

Most Japanese documents are still stored in Shift-JIS or ISO 2022-JP, while Russian users often have their documents in KOI8-R or Windows-1251.

Apple Roman, Big5, Big5-HKSCS, EUC-JP, EUC-KR, GB18030-0, IBM 850, IBM 866, IBM 874, ISO 2022-JP, ISO 8859-1 to 10, ISO 8859-13 to 16, Iscii-Bng, Dev, Gjr, Knd, Mlm, Ori, Pnj, Tlg, and Tml, JIS X 0201, JIS X 0208, KOI8-R, KOI8-U, uleLao-1, ROMAN8, Shift-JIS, TIS-620, TSCII, UTF-8, UTF-16, UTF-16BE, UTF-16LE, Windows-1250 to 1258, WINSAMI2

Use Qt Linguist to create qm files.

MV_9Mac OS 9 (unsupported)
MV_10_0Mac OS X 10.0 (unsupported)
MV_10_1Mac OS X 10.1 (unsupported)
MV_10_2Mac OS X 10.2 (unsupported)
MV_10_3Mac OS X 10.3
MV_10_4Mac OS X 10.4
MV_10_5Mac OS X 10.5
MV_UnknownAn unknown and currently unsupported platform
MV_CHEETAHMV_10_0 Apple codename for MV_10_0
MV_PUMAMV_10_1 Apple codename for MV_10_1
MV_JAGUARMV_10_2 Apple codename for MV_10_2
MV_PANTHERMV_10_3 Apple codename for MV_10_3
MV_TIGERMV_10_4 Apple codename for MV_10_4
MV_LEOPARDMV_10_5 Apple codename for MV_10_5
WV_32sWindows 3.1 with Win 32s
WV_95Windows 95
WV_98Windows 98
WV_MeWindows Me
WV_NTWindows NT
WV_2000Windows 2000
WV_XPWindows XP
WV_2003Windows Server 2003
WV_VISTAWindows Vista

Maybe a file in the project directory or an absolute path.

Must be an absolute path name, meaning with “c:\…\…\…” on Windows.

This function is particularly useful for applications with many top-level windows.

Possible values are Motif, CDE, Windows, Cleanlooks, Plastique, WindowsXP.

Events in ‘Event’ class:

oder name von image file

Shape Qt::CursorShape Value Cursor Name Shape Qt::CursorShape Value Cursor Name Qt::ArrowCursor left_ptr Qt::SizeVerCursor size_ver Qt::UpArrowCursor up_arrow Qt::SizeHorCursor size_hor Qt::CrossCursor cross Qt::SizeBDiagCursor size_bdiag Qt::IBeamCursor ibeam Qt::SizeFDiagCursor size_fdiag Qt::WaitCursor wait Qt::SizeAllCursor size_all Qt::BusyCursor left_ptr_watch Qt::SplitVCursor split_v Qt::ForbiddenCursor forbidden Qt::SplitHCursor split_h Qt::PointingHandCursor pointing_hand Qt::OpenHandCursor openhand Qt::WhatsThisCursor whats_this Qt::ClosedHandCursor closedhand


Forms

The Qt documentation in C++ of this class (QMainWindow) can be read here: http://doc.trolltech.com/4.3/qmainwindow.html

It is the controller of your forms.

It opens and closes the forms (or activate or deactivate them). There are two types of objects in kbasic: visual objects, and non-visual objects. A visual object is a control and visible at runtime and lets users interact with your application; it has a screen position, a size and a foreground color. Examples of visual objects are forms and buttons. An invisible object is not visible at runtime, such as a timer. Some objects can contain other components, such as an application window containing a button. With KBasic, you add visual objects/controls to your forms to assemble applications.

Projects keep your work together. When developing an appication in kbasic, you work mainly with projects. A project is a collection of files that make up your application. You create a project ot manage and organize these files. KBasic provides an easy yet sophisticated system to manage the collection fo files that make up a project. The project window shows each item in a project. Starting a new application with KBasic begins with the creation fo a project. So before you can construct an application, you need to create a new project. A project consists of many separate files collected in one project directory, where one *.kbasic_project file is and many other files:

The Forms class may only be used, if project's main form is set to “Main()” (see properties of project). Additionally, myMenuBar menubar class must be created and the project type property must be set to “MDI Application”. If you are not sure about how to set all settings, create a new project with type MDI application.

Open a form

Opening is easy use the following code:

  Dim f As FORMNAME = New FORMNAME : f.Open()

E.g. if you form is named Form1 you have to write

  Dim f As Form1 = New Form1 : f.Open()

' OR

Forms.Open("FORMNAME") ' for this call you must setup mainwindow in projects properties

Methods:

Returns the name of the form, which has got the focus currently.

Returns the name of the first form in the form list. Only opened forms are in this list and only normal forms (forms which are not DockWindows or Dialogs).

Example

Dim n As String

n = Forms.First()

If n <> "" Then

  Do
    Dim f As Form
    f = Forms.Form(n)
    ' place your code here
    
    n = Forms.Next()
  Loop While n <> ""

End If

Returns the name of the next form in the form list and only normal forms (forms which are not DockWindows or Dialogs).. If it returns and empty string, there is no further form.

Sets the focus to the form you wish.

Events in 'Event' class:

It is possible that FormName is ””, which means no form has got focus right now. If so, you ought to set the menubar and toolbar entries disabled or enabled as it is expected to work, when no form has got focus.

Not implemented yet:


Pixmaps

The Qt documentation in C++ of this class (QPixmap) can be read here: http://doc.trolltech.com/4.3/qixmap.html

See the paint project example for seeing how to use the pixmaps class.

Pixmaps is a list of Pixmap.

Methods Of Pixmaps:

__**Not implemented yet:**__

Pixmaps{"WATER"} = "water.jpg"

  * Static Function SetPixmap(Id As String, Pixmap) As Boolean

  * Static Function AddNewPixmap(Id As String) As Boolean

  * Static Function Width(String) As Integer

  * Static Function Height(String) As Integer

Methods Of Pixmap:

  * Function Load(FileName As String) As Boolean

Properties Of Pixmap:

  * Property Width As Integer (ReadOnly)

  * Property Height As Integer (ReadOnly)


Const TESTJPG = "c:\test.jpg"

Dim testjpg As Pixmap

testjpg.Load(TESTJPG) ' Pixmaps contains TESTJPG after call of Load

testjpg = Pixmaps.Pixmap(TESTJPG)

in PaintEvent(...) DrawPixmap(0, 11, testjpg) "faster than" DrawPixmap(0, 11, Pixmaps.Pixmap(TESTJPG)) 



Colors

The Qt documentation in C++ of this class (QColor) can be read here: http://doc.trolltech.com/4.3/qcolor.html

Colors is a list of Color.

Methods Of Colors:

A = 0 means fully transparent, A = 255 means fully visible

Methods Of Color:

Predefined colors are:

Color.White, Color.Black, Color.Red, Color.DarkRed, Color.Green, Color.DarkGreen, Color.Blue, Color.DarkBlue, Color.Cyan, Color.DarkCyan, Color.Magenta, Color.DarkMagenta, Color.Yellow, Color.DarkYellow, Color.Gray, Color.DarkGray, Color.LightGray, Color.Color0, Color.Color1, and Color.Transparent.

Beware that you use the predefined color objects for property control colors with the right syntax.

Background = Color.Red ' !Wrong!
Background = "Color.Red" ' right
Background = "Red" ' right

Not implemented yet:


Fonts

The Qt documentation in C++ of this class (QFont) can be read here: http://doc.trolltech.com/4.3/qfont.html

Fonts is a list of Font.

Methods Of Fonts:

Methods Of Font:

0Not implemented yet:


Paint

The Qt documentation in C++ of this class (QPainter) can be read here: http://doc.trolltech.com/4.3/qpainter.html

You might want to use it to override the event methods of Control, when you would like to implement your own controls for display data or interact with the user. You must override OnPaint(…) and use the following functions.

Example

Your form contains of Box0 (control type Box).

Sub Box0_OnPaint(X As Integer, Y As Integer, Width As Integer, Height As Integer)
  DrawRect(11, 22, 33, 44)
End Sub

Use the following paint functions:

The Qt documentation says

The StartAngle and SpanAngle must be specified in 1/16th of a degree, i.e. a full circle equals 5760 (16 * 360). Positive values for the angles mean counter-clockwise while negative values mean the clockwise direction. Zero degrees is at the 3 o'clock position.



Possible values for BrushStyle are:



Possible values for PenStyle are:



Possible values for PenCapStyle are:



Possible values for PenCapStyle are:



Not implemented yet:

1Some familiar function names:

  Paint.SetPen(Color.Black)
  Paint.DrawText(10, 19, "Time: " & YY)
  
  Paint.SetPen(Color.Black)
  Paint.DrawText(10, 20, "Time: " & YY)
 
  Paint.SetPen(Color.Black)
  Paint.DrawText(10, 21, "Time: " & YY)
 
  Paint.SetPen(Color.Black)
  Paint.DrawText(11, 19, "Time: " & YY)
  
  Paint.SetPen(Color.Black)
  Paint.DrawText(11, 20, "Time: " & YY)

  Paint.SetPen(Color.Black)
  Paint.DrawText(11, 21, "Time: " & YY)

  Paint.SetPen(Color.Black)
  Paint.DrawText(12, 19, "Time: " & YY)

  Paint.SetPen(Color.Black)
  Paint.DrawText(12, 20, "Time: " & YY)

  Paint.SetPen(Color.Black)
  Paint.DrawText(12, 21, "Time: " & YY)

    Paint.SetPen(Color.White)
    Paint.DrawText(11, 20, "Time: " & YY)
'