Ein paar Mini Gambas Programme  ( Minisinis)  zurück zu Gambas


Programmieren scheint sehr kompliziert zu sein. Um es auch Anfängern schmackhaft zu machen , habe ich auf dieser Seite ein paar Miniprogramme für Gambas unter Linux KDE aufgelistet.

Ganz am Anfang brauchen Sie    Wie plaziert man ein Programm in KDE      Iconerstellung

Hinweise zum Download der Programme aus dem Internet     Die Werkzeugkiste = Toolbox

Auch in in Visual Basic habe ich einige Miniprogramme geschrieben, diese sind in folgender Liste teilweise noch zu finden und werden nach und nach umgeschrieben.


Textdarstellung      Variablen  Variablen deklarieren   Variablen umwandeln Format    Maus  Grafik  Form    Rechenkünste  10Künste    Zufall   

 Balken    Schleifen   Zeit   Wecker   Ereignis   Logik    Farben      Funktion      Klasse      Array   Gitter  WWW   Zwischenablage

    Dateien     Sound    Drucken     Datenbank   Menu    Fehlermanagement   Systeminfo  Werkzeugkiste

Fehlermeldungen   GB-Komponenten   Fragen     Das Drumherum

Wollen Sie auch ein Miniprogramm erstellen ? So geht es .


Textdarstellung

Texteingabe

Textbearbeitung ( Befehlsübersicht zur String Bearbeitung)

Programmstart



Programmende



Programm abwürgen

<



Kommentare eingeben

<

Variable

<

Variablen festlegen

Private , Public oder Static Was soll das ?

Variablen umwandeln

Format

format Befehl

Gitter

Array Wieso funktionieren Arrays im Terminalmodus nicht ?

Farben

Schleifen



In Form bleiben

Menu



Rechenkünste

Fehler beim Rechnen noch in vb



Logik:



Balken



Datum und Zeit

Der Wecker klingelt

Umgang mit Dateien

COPY

KILL

MKDIR

RENAME

RMDIR

Input/Output

CLOSE

FLUSH

INPUT

LINE INPUT

OPEN

PRINT

READ

SEEK

WRITE



Rein Zufällig Statistik und Stochastik

<

Ereignisse

Maus



Bewegung



Grafik

From: Eilert <eilert-sprachen@t-...>

Draw.Text adapted to DrawingArea ?

2005-02-14 03:10





Hi all,

Just wondering how Draw.Text (and the text painting functions) could be

recalculated to fit to the size of the DrawingArea.

Yes, I know, if I say Draw.Font.Size = 12 it will be 12 pts, but

reference for it is the desktop"s resolution. I"m doing a preview, and

for this preview to show me an A4 page in real size I have to give 82

instead of Desktop.Resolution (which results in somewhat smaller

measures). This didn"t matter up to now. I"ve introduced some graphics

functions which show lines and stuff, all work ok because they use a

function to recalculate millimeters into screen pixels.

Now with fonts, as long as I keep the preview 1:1 with reality,

everything appeares correct. But what if I decide to have a preview of

1/2 or 1/4 size?

As all sizes are measured in points on the screen, my question is, what

can I do to evaluate the appearence of a font and resize it accordingly?

The Draw.Text() function has a width and height option, but I don"t

understand how it works (no examples in the help) and I don"t know if it

would be of any help here.

Rolf









From: Laurent Carlier <lordheavy@in...>

Re: Draw.Text adapted to DrawingArea ?

2005-02-14 04:23





Le Lundi 14 Février 2005 12:10, Eilert a écrit :

> The Draw.Text() function has a width and height option, but I don"t

> understand how it works (no examples in the help) and I don"t know if it

> would be of any help here.

draw.textHeight("my text") return the height of the text (my text) in pixels,

draw.textWidth("my text") return the width of the text (my text) in pixels.

--

Laurent Carlier









From: Eilert <eilert-sprachen@t-...>

Re: Draw.Text adapted to DrawingArea ?

2005-02-14 06:11





Ah Laurent, I think I didn"t explain clear enough what I want. Let me

say it this way:

When I start my preview, I call a function that recalculates millimeters

into screen pixels. The DrawingArea has to be adjusted in measures of

screen pixels. My little function take the Desktop.Resolution and

computes the necessary number of pixels to let the DrawingArea as wide

and as long as necessary for an A4 page.

The problem is that it miscalculates a bit (maybe 10 %) because

"Desktop.Resolution" says something like 76, and it would be 82 to make

a "real" A4 sheet (I compared it on the screen).

So everything appears somewhat smaller than A4. No problem, BUT WITH FONTS:

Fonts are sized in pts, i. e. points, and not screen pixels. The

function behind this in Qt recalculates my "Courier 12" into the

necessary number of screen pixels for a page with Desktop.Resolution 76,

not 82. So on my somewhat smaller page, all fonts appear slightly too big.

What I am looking for is an easy way to rescale the fonts to a size

which fits to the scale of my DrawingArea, maybe something like a

pts-to-screen-pixel ratio.

Rolf

Laurent Carlier schrieb:

> Le Lundi 14 Février 2005 12:10, Eilert a écrit :

>

>>The Draw.Text() function has a width and height option, but I don"t

>>understand how it works (no examples in the help) and I don"t know if it

>>would be of any help here.

>

>

> draw.textHeight("my text") return the height of the text (my text) in pixels,

> draw.textWidth("my text") return the width of the text (my text) in pixels.

>









From: Benoit Minisini <gambas@us...>

Re: Draw.Text adapted to DrawingArea ?

2005-02-14 06:17





On Monday 14 February 2005 15:11, Eilert wrote:

> Ah Laurent, I think I didn"t explain clear enough what I want. Let me

> say it this way:

>

> When I start my preview, I call a function that recalculates millimeters

> into screen pixels. The DrawingArea has to be adjusted in measures of

> screen pixels. My little function take the Desktop.Resolution and

> computes the necessary number of pixels to let the DrawingArea as wide

> and as long as necessary for an A4 page.

>

> The problem is that it miscalculates a bit (maybe 10 %) because

> "Desktop.Resolution" says something like 76, and it would be 82 to make

> a "real" A4 sheet (I compared it on the screen).

>

> So everything appears somewhat smaller than A4. No problem, BUT WITH FONTS:

>

> Fonts are sized in pts, i. e. points, and not screen pixels. The

> function behind this in Qt recalculates my "Courier 12" into the

> necessary number of screen pixels for a page with Desktop.Resolution 76,

> not 82. So on my somewhat smaller page, all fonts appear slightly too big.

>

> What I am looking for is an easy way to rescale the fonts to a size

> which fits to the scale of my DrawingArea, maybe something like a

> pts-to-screen-pixel ratio.

>

> Rolf

>

Font has its own resolution settings, that is used only when displaying on a

screen (not on a printer).

I mean there is a Font.Resolution property that can be different from

Desktop.Resolution. By default, Font.Resolution = 96. But you can change it

if you need.

Regards,

--

Benoit Minisini

mailto:gambas@us...









From: Eilert <eilert-sprachen@t-...>

Re: Draw.Text adapted to DrawingArea ?

2005-02-14 23:19





Thanks Benoit, that"s it:

Font.Resolution = Desktop.Resolution

When I let it size the preview according to Desktop.Resolution, this

will make the fonts appear in a natural way.

Benoit Minisini schrieb:

> On Monday 14 February 2005 15:11, Eilert wrote:

>

>>Ah Laurent, I think I didn"t explain clear enough what I want. Let me

>>say it this way:

>>

>>When I start my preview, I call a function that recalculates millimeters

>>into screen pixels. The DrawingArea has to be adjusted in measures of

>>screen pixels. My little function take the Desktop.Resolution and

>>computes the necessary number of pixels to let the DrawingArea as wide

>>and as long as necessary for an A4 page.

>>

>>The problem is that it miscalculates a bit (maybe 10 %) because

>>"Desktop.Resolution" says something like 76, and it would be 82 to make

>>a "real" A4 sheet (I compared it on the screen).

>>

>>So everything appears somewhat smaller than A4. No problem, BUT WITH FONTS:

>>

>>Fonts are sized in pts, i. e. points, and not screen pixels. The

>>function behind this in Qt recalculates my "Courier 12" into the

>>necessary number of screen pixels for a page with Desktop.Resolution 76,

>>not 82. So on my somewhat smaller page, all fonts appear slightly too big.

>>

>>What I am looking for is an easy way to rescale the fonts to a size

>>which fits to the scale of my DrawingArea, maybe something like a

>>pts-to-screen-pixel ratio.

>>

>>Rolf

>>

>

>

> Font has its own resolution settings, that is used only when displaying on a

> screen (not on a printer).

>

> I mean there is a Font.Resolution property that can be different from

> Desktop.Resolution. By default, Font.Resolution = 96. But you can change it

> if you need.

>

> Regards,

>



01 Dateien



Zwischenablage = Clipboard



Töne



Datenbank

Drucken



Funktionen



Klassen und Objekte

Objekt und Klasse allgemein

Angst vor Objekten, dann hilft dieser Link   http://sepwww.stanford.edu/sep/josman/oop/oop1.htm

Klasse allgemein

Klasse 1

Classes

Vordefinierte Klassen in Gambas

Der Constructor

Klasse 2

Objekt erschaffen, testen , löschen , Cthing

WWW

Werkzeugkiste

Neue Controls auf die Form setzen

Scrollview

Timer

DrawingArea

GB Komponenten

Zusätzliche Komponenten laden

Zusätzliche Gambas Komponenten kann man über den Menüpunkt Projekt – Eigenschaften des Gambashauptbildschirmes erreichen. In der Komponentenanzeige wählt man die gewünschten Komponenten aus.

In der Werkzeugbox erscheint dann zb eine Schrift mit der Bezeichnung QT . Diese klickt man an und hat dann eine Reihe weiterer Steuerelemente zur Verfügung.

Liste der derzeitige Gambaskomponenten

gb

Gambas internal native classes

gb.compress

Compression library

gb.db

Database access component

gb.debug

Gambas application debugger helper

gb.eval

Gambas expression evaluator

gb.net

Networking component

Controls: DnsClient, ServerSocket, SerialPort, Socket, UdpSocket

gb.qt

Graphical QT toolkit component

Controls: Label, TextLabel, PictureBox, ProgressBar, Button, CheckBox, RadioButton, ToggleButton, ToolButton, TextBox, ComboBox, TextArea, ListBox, ListView, TreeView, IconView, GridView, ColumnView, HBox, VBox, HPanel, VPanel, Frame, Panel, TabStrip, ScrollView, DrawingArea, Timer

gb.qt.editor

Gambas editor with syntax highlighting

Controls: GambasEditor

gb.qt.ext

Graphical QT toolkit extension component

Controls: LCDNumber, Dial, SpinBox, ScrollBar, Slider, MovieBox, TableView, HSplit, VSplit, Workspace, TextView

gb.qt.kde

KDE integration and scripting

Controls: URLLabel, ColorBox, DatePicker

WARNUNG! Folgende Komponenten befinden sich noch im BETA Stadium und können sich daher jederzeit ändern.

gb.qt.kde.html

KDE web browser

gb.vb

Visual Basic compatibility

gb.xml.libxml

XML tools based on libxml

gb.xml.libxml.rpc

XML-RPC client based on libxml and libcurl

gb.xml.libxml.xslt

XSLT tools based on libxslt

Componenten auflisten

Systeminfo

Systeminfo mit der System Class

Application infos

Das Drumherum, Wo steht was

Vorgegebene Konstanten

Fehler management

CATCH

FINALLY

TRY

Fehlermeldungen