[INFORMER]
* NEW: The informer now can generate component information files for components that do not export any class in their C/C++ part. [GB.DB.MYSQL] * NEW: Import the MySQL specific component made by David Villalobos Cambronero. [GB.FORM.DIALOG] * BUG: Standard dialogs now correctly react to double clicks. [GB.PDF] * BUG: The component now can really be compiled with poppler 0.8. git-svn-id: svn://localhost/gambas/trunk@1357 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
2a096fea20
commit
9ed30bf516
49 changed files with 4352 additions and 3416 deletions
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
@ -65,6 +65,7 @@ Static Private Sub InitComponentNames()
|
|||
$cName["gb.crypt"] = ("MD5/DES crypting")
|
||||
$cName["gb.db"] = ("Database access")
|
||||
$cName["gb.db.form"] = ("Data bound controls")
|
||||
$cName["gb.db.mysql"] = ("MySQL specific routines")
|
||||
$cName["gb.debug"] = ("Application debugger helper")
|
||||
$cName["gb.desktop"] = ("Desktop-neutral routines from Portland project")
|
||||
$cName["gb.eval"] = ("Expression evaluator")
|
||||
|
@ -87,11 +88,14 @@ Static Private Sub InitComponentNames()
|
|||
$cName["gb.pdf"] = ("PDF renderer based on Poppler library")
|
||||
$cName["gb.qt"] = ("QT toolkit")
|
||||
$cName["gb.qt.ext"] = ("QT toolkit extension")
|
||||
$cName["gb.qt4"] = ("QT4 toolkit")
|
||||
$cName["gb.qt4.ext"] = ("QT4 toolkit extension")
|
||||
$cName["gb.qte"] = ("QT/Embedded toolkit")
|
||||
$cName["gb.qte.ext"] = ("QT/Embedded toolkit extension")
|
||||
$cName["gb.qt.kde"] = ("KDE integration and scripting")
|
||||
$cName["gb.qt.kde.html"] = ("KDE web browser")
|
||||
$cName["gb.qt.opengl"] = ("OpenGL with QT toolkit")
|
||||
$cName["gb.qt4.opengl"] = ("OpenGL with QT4 toolkit")
|
||||
$cName["gb.report"] = ("Report designer")
|
||||
$cName["gb.sdl"] = ("SDL library")
|
||||
$cName["gb.sdl.sound"] = ("SDL sound & CD-ROM management")
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
ShowBookmark = True
|
||||
}
|
||||
{ Expander1 Expander
|
||||
MoveScaled(2,47,70,16)
|
||||
MoveScaled(2,47,70,17)
|
||||
Arrangement = Arrange.Vertical
|
||||
Spacing = 8
|
||||
Text = ("Options")
|
||||
|
|
|
@ -437,7 +437,6 @@
|
|||
}
|
||||
{ panNeed Panel
|
||||
MoveScaled(1,4,80,16)
|
||||
Arrangement = Arrange.Vertical
|
||||
{ CheckBox5 CheckBox
|
||||
MoveScaled(0,1,43,3)
|
||||
Tag = "Form"
|
||||
|
@ -463,22 +462,22 @@
|
|||
MoveScaled(1,25,80,45)
|
||||
Spacing = 8
|
||||
{ VBox4 VBox
|
||||
MoveScaled(1,1,59,35)
|
||||
MoveScaled(1,1,56,35)
|
||||
Expand = True
|
||||
Spacing = 8
|
||||
{ cmbRequire ComboBox
|
||||
MoveScaled(0,0,58,4)
|
||||
MoveScaled(0,0,55,4)
|
||||
Text = ("")
|
||||
ReadOnly = True
|
||||
}
|
||||
{ lstRequire ListBox
|
||||
MoveScaled(0,4,58,29)
|
||||
MoveScaled(0,4,55,29)
|
||||
Expand = True
|
||||
Sorted = True
|
||||
}
|
||||
}
|
||||
{ VBox5 VBox
|
||||
MoveScaled(61,1,17,35)
|
||||
MoveScaled(58,1,21,35)
|
||||
Spacing = 8
|
||||
{ btnAdd Button
|
||||
MoveScaled(0,0,17,4)
|
||||
|
|
|
@ -10,7 +10,3 @@ Environment="GB_GUI=gb.gtk"
|
|||
TabSize=2
|
||||
MakeComponent=1
|
||||
State=2
|
||||
Maintainer=benoit
|
||||
Vendor=Princeton
|
||||
Address=benoit@localhost
|
||||
License=General Public Licence
|
||||
|
|
|
@ -13,12 +13,3 @@ Translate=1
|
|||
Language=en
|
||||
KeepDebugInfo=1
|
||||
MakeComponent=1
|
||||
Maintainer=fabien
|
||||
Vendor=Princeton
|
||||
Address=fabien@arcalis
|
||||
License=General Public Licence
|
||||
Prefix=1
|
||||
Systems=autotools
|
||||
Menus=
|
||||
Categories=
|
||||
Groups=
|
||||
|
|
|
@ -5,6 +5,10 @@ Paths
|
|||
R
|
||||
String[]
|
||||
|
||||
Date
|
||||
P
|
||||
d
|
||||
|
||||
OpenFile
|
||||
M
|
||||
b
|
||||
|
@ -17,3 +21,7 @@ SelectDirectory
|
|||
M
|
||||
b
|
||||
|
||||
SelectDate
|
||||
M
|
||||
b
|
||||
|
||||
|
|
|
@ -17,19 +17,24 @@ msgstr ""
|
|||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Poedit-Language: Catalan\n"
|
||||
|
||||
#: FDirDialog.class:81 FFileDialog.class:47
|
||||
#: FDirDialog.class:83 FFileDialog.class:102 FInputDate.class:84
|
||||
msgid "OK"
|
||||
msgstr "D'acord"
|
||||
|
||||
#: FDirDialog.class:89 FFileDialog.class:47 FInputDate.class:90
|
||||
msgid "Cancel"
|
||||
msgstr "Canceŀla"
|
||||
|
||||
#: FDirDialog.class:75 FFileDialog.class:94
|
||||
msgid "OK"
|
||||
msgstr "D'acord"
|
||||
#: FFileDialog.class:47
|
||||
msgid ""
|
||||
"This file already exists.\n"
|
||||
"\n"
|
||||
"Do you want to overwrite it?"
|
||||
msgstr ""
|
||||
"Aquest fitxer ja existeix.\n"
|
||||
"\n"
|
||||
"El voleu sobreescriure?"
|
||||
|
||||
#: FFileDialog.class:47
|
||||
msgid "&Overwrite"
|
||||
msgstr "&Sobreescriu"
|
||||
|
||||
#: FFileDialog.class:47
|
||||
msgid "This file already exists.\n\nDo you want to overwrite it?"
|
||||
msgstr "Aquest fitxer ja existeix.\n\nEl voleu sobreescriure?"
|
||||
|
||||
|
|
BIN
comp/src/gb.form.dialog/.lang/de.mo
Normal file
BIN
comp/src/gb.form.dialog/.lang/de.mo
Normal file
Binary file not shown.
28
comp/src/gb.form.dialog/.lang/de.po
Normal file
28
comp/src/gb.form.dialog/.lang/de.po
Normal file
|
@ -0,0 +1,28 @@
|
|||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"POT-Creation-Date: 2002-11-01 04:27+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: FDirDialog.class:89 FFileDialog.class:47 FInputDate.class:90
|
||||
msgid "Cancel"
|
||||
msgstr "Abbrechen"
|
||||
|
||||
#: FDirDialog.class:83 FFileDialog.class:102 FInputDate.class:84
|
||||
msgid "OK"
|
||||
msgstr "OK"
|
||||
|
||||
#: FFileDialog.class:47
|
||||
msgid "&Overwrite"
|
||||
msgstr "Ü&berschreiben"
|
||||
|
||||
#: FFileDialog.class:47
|
||||
msgid "This file already exists.\n\nDo you want to overwrite it?"
|
||||
msgstr ""
|
||||
|
|
@ -10,11 +10,11 @@ msgstr ""
|
|||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: FDirDialog.class:77 FFileDialog.class:96
|
||||
#: FDirDialog.class:83 FFileDialog.class:102 FInputDate.class:84
|
||||
msgid "OK"
|
||||
msgstr "OK"
|
||||
|
||||
#: FDirDialog.class:83 FFileDialog.class:47
|
||||
#: FDirDialog.class:89 FFileDialog.class:47 FInputDate.class:90
|
||||
msgid "Cancel"
|
||||
msgstr "Cancelar"
|
||||
|
||||
|
|
|
@ -10,15 +10,15 @@ msgstr ""
|
|||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: FDirDialog.class:75 FFileDialog.class:96
|
||||
#: FDirDialog.class:83 FFileDialog.class:102 FInputDate.class:84
|
||||
msgid "OK"
|
||||
msgstr "OK"
|
||||
|
||||
#: FDirDialog.class:81 FFileDialog.class:49
|
||||
#: FDirDialog.class:89 FFileDialog.class:47 FInputDate.class:90
|
||||
msgid "Cancel"
|
||||
msgstr "Annuler"
|
||||
|
||||
#: FFileDialog.class:49
|
||||
#: FFileDialog.class:47
|
||||
msgid ""
|
||||
"This file already exists.\n"
|
||||
"\n"
|
||||
|
@ -28,6 +28,6 @@ msgstr ""
|
|||
"\n"
|
||||
"Désirez-vous le remplacer ?"
|
||||
|
||||
#: FFileDialog.class:49
|
||||
#: FFileDialog.class:47
|
||||
msgid "&Overwrite"
|
||||
msgstr "&Remplacer"
|
||||
|
|
|
@ -10,19 +10,24 @@ msgstr ""
|
|||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: FDirDialog.class:81 FFileDialog.class:49
|
||||
msgid "Cancel"
|
||||
msgstr "キャンセル"
|
||||
|
||||
#: FDirDialog.class:75 FFileDialog.class:96
|
||||
#: FDirDialog.class:83 FFileDialog.class:102 FInputDate.class:84
|
||||
msgid "OK"
|
||||
msgstr "-"
|
||||
|
||||
#: FFileDialog.class:49
|
||||
#: FDirDialog.class:89 FFileDialog.class:47 FInputDate.class:90
|
||||
msgid "Cancel"
|
||||
msgstr "キャンセル"
|
||||
|
||||
#: FFileDialog.class:47
|
||||
msgid ""
|
||||
"This file already exists.\n"
|
||||
"\n"
|
||||
"Do you want to overwrite it?"
|
||||
msgstr ""
|
||||
"ファイルが既に存在します。\n"
|
||||
"\n"
|
||||
"上書きしますか?"
|
||||
|
||||
#: FFileDialog.class:47
|
||||
msgid "&Overwrite"
|
||||
msgstr "上書き(&O)"
|
||||
|
||||
#: FFileDialog.class:49
|
||||
msgid "This file already exists.\n\nDo you want to overwrite it?"
|
||||
msgstr "ファイルが既に存在します。\n\n上書きしますか?"
|
||||
|
||||
|
|
|
@ -10,19 +10,24 @@ msgstr ""
|
|||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: FDirDialog.class:83 FFileDialog.class:47
|
||||
#: FDirDialog.class:83 FFileDialog.class:102 FInputDate.class:84
|
||||
msgid "OK"
|
||||
msgstr "OK"
|
||||
|
||||
#: FDirDialog.class:89 FFileDialog.class:47 FInputDate.class:90
|
||||
msgid "Cancel"
|
||||
msgstr "Avbryt"
|
||||
|
||||
#: FDirDialog.class:77 FFileDialog.class:96
|
||||
msgid "OK"
|
||||
msgstr "OK"
|
||||
#: FFileDialog.class:47
|
||||
msgid ""
|
||||
"This file already exists.\n"
|
||||
"\n"
|
||||
"Do you want to overwrite it?"
|
||||
msgstr ""
|
||||
"Denna fil finns redan.\n"
|
||||
"\n"
|
||||
"Vill du skriva över den?"
|
||||
|
||||
#: FFileDialog.class:47
|
||||
msgid "&Overwrite"
|
||||
msgstr "&Skriv över"
|
||||
|
||||
#: FFileDialog.class:47
|
||||
msgid "This file already exists.\n\nDo you want to overwrite it?"
|
||||
msgstr "Denna fil finns redan.\n\nVill du skriva över den?"
|
||||
|
||||
|
|
|
@ -11,7 +11,3 @@ Translate=1
|
|||
Language=en
|
||||
KeepDebugInfo=1
|
||||
MakeComponent=1
|
||||
Maintainer=benoit
|
||||
Vendor=Princeton
|
||||
Address=benoit@localhost
|
||||
License=General Public Licence
|
||||
|
|
|
@ -2,38 +2,44 @@
|
|||
|
||||
' Gambas class file
|
||||
|
||||
PRIVATE $bReadOnly AS Boolean
|
||||
Private $bReadOnly As Boolean
|
||||
|
||||
PUBLIC SUB SelectDirectory() AS Boolean
|
||||
Public Sub SelectDirectory() As Boolean
|
||||
|
||||
RETURN NOT ME.ShowModal()
|
||||
Return Not Me.ShowModal()
|
||||
|
||||
END
|
||||
End
|
||||
|
||||
PUBLIC SUB Form_Open()
|
||||
Public Sub Form_Open()
|
||||
|
||||
' DEBUG "Dialog.Title:";; Dialog.Title
|
||||
' DEBUG "Dialog.Path:";; Dialog.Path
|
||||
|
||||
ME.Title = Dialog.Title
|
||||
Me.Title = Dialog.Title
|
||||
dchChoose.Root = "/"
|
||||
IF NOT Dialog.Path THEN
|
||||
If Not Dialog.Path Then
|
||||
dchChoose.SelectedPath = "~"
|
||||
ELSE
|
||||
Else
|
||||
dchChoose.SelectedPath = Dialog.Path
|
||||
ENDIF
|
||||
Endif
|
||||
|
||||
END
|
||||
End
|
||||
|
||||
PUBLIC SUB btnOK_Click()
|
||||
Public Sub btnOK_Click()
|
||||
|
||||
Dialog.Path = dchChoose.SelectedPath
|
||||
ME.Close(TRUE)
|
||||
Me.Close(True)
|
||||
|
||||
END
|
||||
End
|
||||
|
||||
PUBLIC SUB btnCancel_Click()
|
||||
Public Sub btnCancel_Click()
|
||||
|
||||
ME.Close
|
||||
Me.Close
|
||||
|
||||
END
|
||||
End
|
||||
|
||||
Public Sub dchChoose_Activate()
|
||||
|
||||
btnOK.Value = True
|
||||
|
||||
End
|
||||
|
|
|
@ -1,58 +1,64 @@
|
|||
' Gambas class file
|
||||
|
||||
STATIC PUBLIC Paths AS String[]
|
||||
Static Public Paths As String[]
|
||||
|
||||
PRIVATE $bMulti AS Boolean
|
||||
PRIVATE $bReadOnly AS Boolean
|
||||
Private $bMulti As Boolean
|
||||
Private $bReadOnly As Boolean
|
||||
|
||||
PUBLIC SUB OpenFile(bMulti AS Boolean) AS Boolean
|
||||
Public Sub OpenFile(bMulti As Boolean) As Boolean
|
||||
|
||||
$bMulti = bMulti
|
||||
$bReadOnly = TRUE
|
||||
RETURN NOT ME.ShowModal()
|
||||
$bReadOnly = True
|
||||
Return Not Me.ShowModal()
|
||||
|
||||
END
|
||||
End
|
||||
|
||||
PUBLIC SUB SaveFile() AS Boolean
|
||||
Public Sub SaveFile() As Boolean
|
||||
|
||||
$bMulti = FALSE
|
||||
$bReadOnly = FALSE
|
||||
RETURN NOT ME.ShowModal()
|
||||
$bMulti = False
|
||||
$bReadOnly = False
|
||||
Return Not Me.ShowModal()
|
||||
|
||||
END
|
||||
End
|
||||
|
||||
|
||||
PUBLIC SUB Form_Open()
|
||||
Public Sub Form_Open()
|
||||
|
||||
' DEBUG "Dialog.Title:";; Dialog.Title
|
||||
' DEBUG "Dialog.Path:";; Dialog.Path
|
||||
|
||||
ME.Title = Dialog.Title
|
||||
Me.Title = Dialog.Title
|
||||
fchChoose.ReadOnly = $bReadOnly
|
||||
fchChoose.Multi = $bMulti
|
||||
'fchChoose.Root = "/"
|
||||
fchChoose.Filter = Dialog.Filter
|
||||
IF Dialog.Path THEN
|
||||
If Dialog.Path Then
|
||||
fchChoose.SelectedPath = Dialog.Path
|
||||
ENDIF
|
||||
Endif
|
||||
|
||||
END
|
||||
End
|
||||
|
||||
PUBLIC SUB btnOK_Click()
|
||||
Public Sub btnOK_Click()
|
||||
|
||||
Dialog.Path = fchChoose.SelectedPath
|
||||
IF fchChoose.Multi THEN Paths = fchChoose.SelectedPaths
|
||||
IF NOT fchChoose.ReadOnly THEN
|
||||
IF Exist(fchChoose.SelectedPath) THEN
|
||||
IF Message.Warning(("This file already exists.\n\nDo you want to overwrite it?"), ("&Overwrite"), ("Cancel")) = 2 THEN RETURN
|
||||
ENDIF
|
||||
ENDIF
|
||||
ME.Close(TRUE)
|
||||
If fchChoose.Multi Then Paths = fchChoose.SelectedPaths
|
||||
If Not fchChoose.ReadOnly Then
|
||||
If Exist(fchChoose.SelectedPath) Then
|
||||
If Message.Warning(("This file already exists.\n\nDo you want to overwrite it?"), ("&Overwrite"), ("Cancel")) = 2 Then Return
|
||||
Endif
|
||||
Endif
|
||||
Me.Close(True)
|
||||
|
||||
END
|
||||
End
|
||||
|
||||
PUBLIC SUB btnCancel_Click()
|
||||
Public Sub btnCancel_Click()
|
||||
|
||||
ME.Close
|
||||
Me.Close
|
||||
|
||||
END
|
||||
End
|
||||
|
||||
Public Sub fchChoose_Activate()
|
||||
|
||||
btnOK.Value = True
|
||||
|
||||
End
|
||||
|
|
|
@ -32,6 +32,6 @@ End
|
|||
|
||||
Public Sub dlgDate_Activate()
|
||||
|
||||
btnOK_Click()
|
||||
btnOK.Value = True
|
||||
|
||||
End
|
||||
|
|
|
@ -12,7 +12,3 @@ Translate=1
|
|||
Language=en
|
||||
KeepDebugInfo=1
|
||||
MakeComponent=1
|
||||
Maintainer=benoit
|
||||
Vendor=Princeton
|
||||
Address=benoit@desnouettes
|
||||
License=General Public Licence
|
||||
|
|
|
@ -12,12 +12,3 @@ Translate=1
|
|||
Language=en
|
||||
KeepDebugInfo=1
|
||||
MakeComponent=1
|
||||
Maintainer=benoit
|
||||
Vendor=Princeton
|
||||
Address=benoit@desnouettes
|
||||
License=General Public Licence
|
||||
Prefix=1
|
||||
Systems=mandriva
|
||||
Menus=Office/Presentations
|
||||
Categories=Office;Presentation
|
||||
Groups=Books/Other
|
||||
|
|
|
@ -7,7 +7,3 @@ TabSize=2
|
|||
Language=en
|
||||
KeepDebugInfo=1
|
||||
MakeComponent=1
|
||||
Maintainer=benoit
|
||||
Vendor=Princeton
|
||||
Address=benoit@localhost
|
||||
License=General Public Licence
|
||||
|
|
|
@ -13,7 +13,3 @@ Authors=Fabien Bodard
|
|||
TabSize=2
|
||||
MakeComponent=1
|
||||
State=2
|
||||
Maintainer=benoit
|
||||
Vendor=Princeton
|
||||
Address=benoit@localhost
|
||||
License=General Public Licence
|
||||
|
|
|
@ -7,7 +7,3 @@ Authors=Benoît Minisini
|
|||
TabSize=2
|
||||
KeepDebugInfo=1
|
||||
MakeComponent=1
|
||||
Maintainer=benoit
|
||||
Vendor=Princeton
|
||||
Address=benoit@localhost
|
||||
License=General Public Licence
|
||||
|
|
|
@ -7,7 +7,3 @@ Authors=Benoît Minisini
|
|||
TabSize=2
|
||||
KeepDebugInfo=1
|
||||
MakeComponent=1
|
||||
Maintainer=benoit
|
||||
Vendor=Princeton
|
||||
Address=benoit@desnouettes
|
||||
License=General Public Licence
|
||||
|
|
1
gb.db.mysql/component.am
Symbolic link
1
gb.db.mysql/component.am
Symbolic link
|
@ -0,0 +1 @@
|
|||
../component.am
|
|
@ -1,3 +1,6 @@
|
|||
COMPONENT = gb.db.mysql
|
||||
include $(top_srcdir)/component.am
|
||||
|
||||
INCLUDES = @MYSQL_INC@
|
||||
|
||||
gblib_LTLIBRARIES = gb.db.mysql.la
|
||||
|
|
6
gb.db.mysql/src/gb.db.mysql.component
Normal file
6
gb.db.mysql/src/gb.db.mysql.component
Normal file
|
@ -0,0 +1,6 @@
|
|||
[Component]
|
||||
Key=gb.db.mysql
|
||||
Author=David Villalobos Cambronero
|
||||
State=2
|
||||
Requires=gb.db
|
||||
|
6
gb.db.mysql/src/gb.db.mysql/.component
Normal file
6
gb.db.mysql/src/gb.db.mysql/.component
Normal file
|
@ -0,0 +1,6 @@
|
|||
[Component]
|
||||
Key=gb.db.mysql
|
||||
State=2
|
||||
Authors=David Villalobos Cambronero
|
||||
Requires=gb.db
|
||||
|
339
gb.db.mysql/src/gb.db.mysql/.info
Normal file
339
gb.db.mysql/src/gb.db.mysql/.info
Normal file
|
@ -0,0 +1,339 @@
|
|||
#Connection
|
||||
|
||||
C
|
||||
MySQL
|
||||
r
|
||||
_MySQL
|
||||
|
||||
#DB
|
||||
|
||||
C
|
||||
MySQL
|
||||
R
|
||||
_MySQL
|
||||
|
||||
#_DataBase
|
||||
|
||||
CA
|
||||
Process_Error
|
||||
m
|
||||
|
||||
(sError)s
|
||||
Modify
|
||||
m
|
||||
|
||||
(DataBase)s[(CharSet)s(Collation)s]
|
||||
Delete
|
||||
m
|
||||
|
||||
(DataBase)s(IfExists)b
|
||||
Add
|
||||
m
|
||||
|
||||
(DataBase)s[(CharSet)s(Collation)s]
|
||||
Dump
|
||||
m
|
||||
|
||||
[(File)s]
|
||||
#_DataTypes
|
||||
|
||||
CA
|
||||
UnsignedTinyInt
|
||||
C
|
||||
s
|
||||
TINYINT UNSIGNED
|
||||
SignedTinyInt
|
||||
C
|
||||
s
|
||||
TINYINT
|
||||
Bool
|
||||
C
|
||||
s
|
||||
BOOL
|
||||
Boolean
|
||||
C
|
||||
s
|
||||
BOOLEAN
|
||||
SignedSmallInt
|
||||
C
|
||||
s
|
||||
SMALLINT
|
||||
UnsignedSmallInt
|
||||
C
|
||||
s
|
||||
SMALLINT UNSIGNED
|
||||
SignedMediumInt
|
||||
C
|
||||
s
|
||||
MEDIUMINT
|
||||
UnsignedMediumInt
|
||||
C
|
||||
s
|
||||
MEDIUMINT UNSIGNED
|
||||
SignedInt
|
||||
C
|
||||
s
|
||||
INT
|
||||
UnsignedInt
|
||||
C
|
||||
s
|
||||
INT UNSIGNED
|
||||
SignedInteger
|
||||
C
|
||||
s
|
||||
INTEGER
|
||||
UnsignedInteger
|
||||
C
|
||||
s
|
||||
INTEGER UNSIGNED
|
||||
SignedBigInt
|
||||
C
|
||||
s
|
||||
BIGINT
|
||||
UnsignedBigInt
|
||||
C
|
||||
s
|
||||
BIGINT UNSIGNED
|
||||
Serial
|
||||
C
|
||||
s
|
||||
BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE
|
||||
Date
|
||||
C
|
||||
s
|
||||
DATE
|
||||
DateTime
|
||||
C
|
||||
s
|
||||
DATETIME
|
||||
TimeStamp
|
||||
C
|
||||
s
|
||||
TIMESTAMP
|
||||
Time
|
||||
C
|
||||
s
|
||||
TIME
|
||||
TinyBlob
|
||||
C
|
||||
s
|
||||
TINYBLOB
|
||||
MediumBlob
|
||||
C
|
||||
s
|
||||
MEDIUMBLOB
|
||||
LongBlob
|
||||
C
|
||||
s
|
||||
LONGBLOB
|
||||
Bit
|
||||
m
|
||||
s
|
||||
[(Lenght)i]
|
||||
SignedFloat
|
||||
m
|
||||
s
|
||||
(Lenght)i[(Decimals)i]
|
||||
UnsignedFloat
|
||||
m
|
||||
s
|
||||
(Lenght)i[(Decimals)i]
|
||||
SignedDouble
|
||||
m
|
||||
s
|
||||
(Lenght)i[(Decimals)i]
|
||||
UnsignedDouble
|
||||
m
|
||||
s
|
||||
(Lenght)i[(Decimals)i]
|
||||
SignedDoublePrecision
|
||||
m
|
||||
s
|
||||
(Lenght)i[(Decimals)i]
|
||||
UnsignedDoublePrecision
|
||||
m
|
||||
s
|
||||
(Lenght)i[(Decimals)i]
|
||||
SignedReal
|
||||
m
|
||||
s
|
||||
(Lenght)i[(Decimals)i]
|
||||
UnsignedReal
|
||||
m
|
||||
s
|
||||
(Lenght)i[(Decimals)i]
|
||||
SignedDecimal
|
||||
m
|
||||
s
|
||||
(Lenght)i[(Decimals)i]
|
||||
UnsignedDecimal
|
||||
m
|
||||
s
|
||||
(Lenght)i[(Decimals)i]
|
||||
SignedDec
|
||||
m
|
||||
s
|
||||
(Lenght)i[(Decimals)i]
|
||||
UnsignedDec
|
||||
m
|
||||
s
|
||||
(Lenght)i[(Decimals)i]
|
||||
Year
|
||||
m
|
||||
s
|
||||
[(Lenght)i]
|
||||
Char
|
||||
m
|
||||
s
|
||||
[(Lenght)i(CharSet)s(Collation)s]
|
||||
VarChar
|
||||
m
|
||||
s
|
||||
(Lenght)i[(CharSet)s(Collation)s]
|
||||
Binary
|
||||
m
|
||||
s
|
||||
(Lenght)i
|
||||
VarBinary
|
||||
m
|
||||
s
|
||||
(Lenght)i
|
||||
TinyText
|
||||
m
|
||||
s
|
||||
[(Lenght)i(CharSet)s(Collation)s]
|
||||
Blob
|
||||
m
|
||||
s
|
||||
[(Lenght)i]
|
||||
Text
|
||||
m
|
||||
s
|
||||
[(Lenght)i(CharSet)s(Collation)s]
|
||||
MediumText
|
||||
m
|
||||
s
|
||||
[(CharSet)s(Collation)s]
|
||||
LongText
|
||||
m
|
||||
s
|
||||
[(CharSet)s(Collation)s]
|
||||
Enum
|
||||
m
|
||||
s
|
||||
(Values)String[];[(CharSet)s(Collation)s]
|
||||
Set
|
||||
m
|
||||
s
|
||||
(Values)String[];[(CharSet)s(Collation)s]
|
||||
#_Field
|
||||
|
||||
CA
|
||||
PrimaryKey
|
||||
m
|
||||
|
||||
(Fields)String[];
|
||||
Add
|
||||
m
|
||||
|
||||
(Field)s(DataType)s[(AceptNull?)b(DefaultValue)v(AutoIncrement?)b(OnUpdate)s(Comment)s]
|
||||
Index
|
||||
m
|
||||
|
||||
(Index)s(Field)s
|
||||
ForeignKey
|
||||
m
|
||||
|
||||
(Field)s(RefTable)s(RefField)s[(OnDelete)s(OnUpdate)s]
|
||||
#_Index
|
||||
|
||||
CA
|
||||
Add
|
||||
m
|
||||
|
||||
(Index)s(Columns)String[];[(Table)s]
|
||||
Delete
|
||||
m
|
||||
|
||||
(Table)s(Index)s
|
||||
#_MySQL
|
||||
|
||||
C
|
||||
Engine
|
||||
p
|
||||
s
|
||||
|
||||
CharSet
|
||||
p
|
||||
s
|
||||
|
||||
Collation
|
||||
p
|
||||
s
|
||||
|
||||
DataTypes
|
||||
r
|
||||
_DataTypes
|
||||
|
||||
DataBase
|
||||
r
|
||||
_DataBase
|
||||
|
||||
Index
|
||||
r
|
||||
_Index
|
||||
|
||||
Table
|
||||
r
|
||||
_Table
|
||||
|
||||
Field
|
||||
r
|
||||
_Field
|
||||
|
||||
View
|
||||
r
|
||||
_View
|
||||
|
||||
Confirm
|
||||
p
|
||||
b
|
||||
|
||||
_new
|
||||
m
|
||||
|
||||
(hCon)Connection;
|
||||
#_Table
|
||||
|
||||
CA
|
||||
Modify
|
||||
m
|
||||
|
||||
(Table)s(Action)s[(Symbol)s(Definition)s]
|
||||
Add
|
||||
m
|
||||
|
||||
(Table)s[(Engine)s(CharSet)s]
|
||||
Delete
|
||||
m
|
||||
|
||||
(Tables)String[];(IfExists)b
|
||||
LoadData
|
||||
m
|
||||
|
||||
(Table)s(File)s
|
||||
#_View
|
||||
|
||||
CA
|
||||
Modify
|
||||
m
|
||||
|
||||
(View)s(Statement)s
|
||||
Add
|
||||
m
|
||||
|
||||
(View)s(Statement)s[(Replace)b]
|
||||
Delete
|
||||
m
|
||||
|
||||
(Views)String[];(IfExists)b
|
BIN
gb.db.mysql/src/gb.db.mysql/.lang/es.mo
Normal file
BIN
gb.db.mysql/src/gb.db.mysql/.lang/es.mo
Normal file
Binary file not shown.
47
gb.db.mysql/src/gb.db.mysql/.lang/es.po
Normal file
47
gb.db.mysql/src/gb.db.mysql/.lang/es.po
Normal file
|
@ -0,0 +1,47 @@
|
|||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"POT-Creation-Date: 2002-11-01 04:27+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: modMain.module:33
|
||||
msgid "Do you really want to execute the following statement?"
|
||||
msgstr "¿Realmente desea ejecutar la siguiente sentencia?"
|
||||
|
||||
#: modMain.module:33
|
||||
msgid "&Yes"
|
||||
msgstr "&Sí"
|
||||
|
||||
#: modMain.module:33
|
||||
msgid "&No"
|
||||
msgstr "&No"
|
||||
|
||||
#: _MySQL.class:28
|
||||
msgid "Not a MySQL connection."
|
||||
msgstr "No es una conexión MySQL."
|
||||
|
||||
#: _MySQL.class:67
|
||||
msgid "Character Set not valid."
|
||||
msgstr "Character Set no válido."
|
||||
|
||||
#: _MySQL.class:93
|
||||
msgid "Collation not valid."
|
||||
msgstr "Callation no válida."
|
||||
|
||||
#: .project:1
|
||||
msgid "mysql"
|
||||
msgstr "mysql"
|
||||
|
||||
#: .project:2
|
||||
msgid "Creates MySQL statements and executes them."
|
||||
msgstr "Crea sentencias MySQL y las ejecuta."
|
||||
|
||||
#: _Table.class:9
|
||||
msgid "Action no allowed."
|
||||
msgstr "Acción no permitida."
|
9
gb.db.mysql/src/gb.db.mysql/.list
Normal file
9
gb.db.mysql/src/gb.db.mysql/.list
Normal file
|
@ -0,0 +1,9 @@
|
|||
Connection
|
||||
DB
|
||||
_DataBase
|
||||
_DataTypes
|
||||
_Field
|
||||
_Index
|
||||
_MySQL
|
||||
_Table
|
||||
_View
|
20
gb.db.mysql/src/gb.db.mysql/.project
Normal file
20
gb.db.mysql/src/gb.db.mysql/.project
Normal file
|
@ -0,0 +1,20 @@
|
|||
# Gambas Project File 3.0
|
||||
Title=mysql
|
||||
Startup=modMain
|
||||
Version=2.99.1
|
||||
VersionProgram=gbx3 -V
|
||||
Component=gb.qt
|
||||
Component=gb.db
|
||||
Description=Creates MySQL statements and executes them.
|
||||
Authors=David Villalobos Cambronero
|
||||
TabSize=2
|
||||
Translate=1
|
||||
Language=en
|
||||
KeepDebugInfo=1
|
||||
MakeComponent=1
|
||||
State=2
|
||||
ModulePublic=1
|
||||
Maintainer=David Villalobos Cambronero
|
||||
Vendor=Princeton
|
||||
Address=david_villalobos_c@yahoo.com
|
||||
License=General Public Licence
|
12
gb.db.mysql/src/gb.db.mysql/Connection.class
Normal file
12
gb.db.mysql/src/gb.db.mysql/Connection.class
Normal file
|
@ -0,0 +1,12 @@
|
|||
' Gambas class file
|
||||
|
||||
Export
|
||||
|
||||
Property Read MySQL As _MySQL
|
||||
|
||||
Private Sub MySQL_Read() As _MySQL
|
||||
|
||||
Dim $_MySQL As New _MySQL(Me)
|
||||
Return $_MySQL
|
||||
|
||||
End
|
12
gb.db.mysql/src/gb.db.mysql/DB.class
Normal file
12
gb.db.mysql/src/gb.db.mysql/DB.class
Normal file
|
@ -0,0 +1,12 @@
|
|||
' Gambas class file
|
||||
|
||||
Export
|
||||
|
||||
Static Property Read MySQL As _MySQL
|
||||
|
||||
Static Private Sub MySQL_Read() As _MySQL
|
||||
|
||||
Dim $_MySQL As New _MySQL(DB.Current)
|
||||
Return $_MySQL
|
||||
|
||||
End
|
54
gb.db.mysql/src/gb.db.mysql/_DataBase.class
Normal file
54
gb.db.mysql/src/gb.db.mysql/_DataBase.class
Normal file
|
@ -0,0 +1,54 @@
|
|||
' Gambas class file
|
||||
|
||||
Export
|
||||
Create Static
|
||||
|
||||
Public Sub Process_Error(sError As String)
|
||||
|
||||
Error.Raise(Error.Text)
|
||||
|
||||
End
|
||||
|
||||
Public Procedure Modify(DataBase As String, Optional CharSet As String, Optional Collation As String)
|
||||
|
||||
modMain.$Query = "ALTER DATABASE " & DB.Quote(DataBase)
|
||||
If CharSet Then modMain.$Query &= " DEFAULT CHARACTER SET = " & CharSet
|
||||
If Collation Then modMain.$Query &= " DEFAULT COLLATE " & Collation
|
||||
modMain.RunQuery(modMain.$Query)
|
||||
|
||||
End
|
||||
|
||||
Public Procedure Delete(DataBase As String, IfExists As Boolean)
|
||||
|
||||
modMain.$Query = "DROP DATABASE "
|
||||
If IfExists Then modMain.$Query &= "IF EXISTS "
|
||||
modMain.$Query &= DB.Quote(DataBase)
|
||||
modMain.RunQuery(modMain.$Query)
|
||||
|
||||
End
|
||||
|
||||
Public Procedure Add(DataBase As String, Optional CharSet As String, Optional Collation As String)
|
||||
|
||||
modMain.$Query = "CREATE DATABASE " & DB.Quote(DataBase)
|
||||
If CharSet Then modMain.$Query &= " DEFAULT CHARACTER SET = " & CharSet
|
||||
If Collation Then modMain.$Query &= " DEFAULT COLLATE " & Collation
|
||||
modMain.RunQuery(modMain.$Query)
|
||||
|
||||
End
|
||||
|
||||
Public Procedure Dump(Optional File As String)
|
||||
|
||||
Dim sTmp As String
|
||||
|
||||
sTmp = "mysqldump -u " & modMain.$Connection.User & " -h " & modMain.$Connection.Host
|
||||
If modMain.$Connection.Port Then sTmp &= " -P " & modMain.$Connection.Port
|
||||
sTmp &= " --password='" & modMain.$Connection.Password & "' -B " & modMain.$Connection.Name
|
||||
'If Tables Then sTmp &= " " & modMain.ArrayToString(Tables, True)
|
||||
If File Then
|
||||
sTmp &= " > " & File
|
||||
Else
|
||||
sTmp &= " > " & User.Home &/ "Dump_" & modMain.$Connection.Name & ".sql"
|
||||
Endif
|
||||
Shell sTmp For Read
|
||||
|
||||
End
|
239
gb.db.mysql/src/gb.db.mysql/_DataTypes.class
Normal file
239
gb.db.mysql/src/gb.db.mysql/_DataTypes.class
Normal file
|
@ -0,0 +1,239 @@
|
|||
' Gambas class file
|
||||
|
||||
Export
|
||||
Create Static
|
||||
|
||||
Private $Tmp As String
|
||||
|
||||
'MySQL Const Data Types
|
||||
'Numeric Types
|
||||
Public Const UnsignedTinyInt As String = "TINYINT UNSIGNED" 'Range: 0 to 255
|
||||
Public Const SignedTinyInt As String = "TINYINT" 'Range: -128 to 127
|
||||
Public Const Bool As String = "BOOL" 'Range: True or False
|
||||
Public Const Boolean As String = "BOOLEAN" 'Range: True or False
|
||||
Public Const SignedSmallInt As String = "SMALLINT" 'Range: 0 to 65535
|
||||
Public Const UnsignedSmallInt As String = "SMALLINT UNSIGNED" 'Range: -32768 to 32767
|
||||
Public Const SignedMediumInt As String = "MEDIUMINT" 'Range: 0 to 16777215
|
||||
Public Const UnsignedMediumInt As String = "MEDIUMINT UNSIGNED" 'Range: -8388608 to 8388607
|
||||
Public Const SignedInt As String = "INT" 'Range: -2147483648 to 2147483647
|
||||
Public Const UnsignedInt As String = "INT UNSIGNED" 'Range: 0 to 4294967295
|
||||
Public Const SignedInteger As String = "INTEGER" 'Range: -2147483648 to 2147483647
|
||||
Public Const UnsignedInteger As String = "INTEGER UNSIGNED" 'Range: 0 to 4294967295
|
||||
Public Const SignedBigInt As String = "BIGINT" 'Range: -9223372036854775808 to 9223372036854775807
|
||||
Public Const UnsignedBigInt As String = "BIGINT UNSIGNED" 'Range: 0 to 18446744073709551615
|
||||
Public Const Serial As String = "BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE" 'Range: 0 to 18446744073709551615
|
||||
'Date and Time Types
|
||||
Public Const {Date} As String = "DATE" 'Range: '1000-01-01' to '9999-12-31', Formart: 'YYYY-MM-DD'
|
||||
Public Const DateTime As String = "DATETIME" 'Range: '1000-01-01 00:00:00' to '9999-12-31 23:59:59', Formart: 'YYYY-MM-DD HH:MM:SS'
|
||||
Public Const TimeStamp As String = "TIMESTAMP" 'Range: ''1970-01-01 00:00:01' to 2038, Formart: 'YYYY-MM-DD HH:MM:SS'
|
||||
Public Const {Time} As String = "TIME" 'Range: '-838:59:59' to '838:59:59', Formart: 'HH:MM:SS'
|
||||
'String Types
|
||||
Public Const TinyBlob As String = "TINYBLOB" 'Max: 255 (2^8 – 1) bytes
|
||||
Public Const MediumBlob As String = "MEDIUMBLOB" 'Max: 16,777,215 (2^24 – 1) bytes
|
||||
Public Const LongBlob As String = "LONGBLOB" 'Max: 4,294,967,295 or 4GB (2^32 – 1) bytes
|
||||
'End of MySQL Const Data Types
|
||||
|
||||
'DataTypes that requieres arguments
|
||||
Public Function Bit(Optional Lenght As Integer) As String 'Range: 1 to 64
|
||||
|
||||
If Lenght Then
|
||||
Return "BIT(" & Lenght & ")"
|
||||
Else
|
||||
Return "BIT(1)"
|
||||
Endif
|
||||
|
||||
End
|
||||
|
||||
Public Function SignedFloat(Lenght As Integer, Optional Decimals As Integer) As String 'Range: -3.402823466E+38 to -1.175494351E-38 and 0
|
||||
|
||||
If Decimals Then
|
||||
Return "FLOAT(" & Lenght & "," & Decimals & ")"
|
||||
Else
|
||||
Return "FLOAT(" & Lenght & ")"
|
||||
Endif
|
||||
|
||||
End
|
||||
|
||||
Public Function UnsignedFloat(Lenght As Integer, Optional Decimals As Integer) As String 'Range: 1.175494351E-38 to 3.402823466E+38 and 0
|
||||
|
||||
If Decimals Then
|
||||
Return "FLOAT(" & Lenght & "," & Decimals & ") UNSIGNED"
|
||||
Else
|
||||
Return "FLOAT(" & Lenght & ") UNSIGNED"
|
||||
Endif
|
||||
|
||||
End
|
||||
|
||||
Public Function SignedDouble(Lenght As Integer, Optional Decimals As Integer) As String 'Range: -1.7976931348623157E+308 to -2.2250738585072014E-308 and 0
|
||||
|
||||
If Decimals Then
|
||||
Return "DOUBLE(" & Lenght & ", " & Decimals & ")"
|
||||
Else
|
||||
Return "DOUBLE(" & Lenght & ")"
|
||||
Endif
|
||||
|
||||
End
|
||||
|
||||
Public Function UnsignedDouble(Lenght As Integer, Optional Decimals As Integer) As String 'Range: 2.2250738585072014E-308 to 1.7976931348623157E+308 and 0
|
||||
|
||||
If Decimals Then
|
||||
Return "DOUBLE(" & Lenght & ", " & Decimals & ") UNSIGNED"
|
||||
Else
|
||||
Return "DOUBLE(" & Lenght & ") UNSIGNED"
|
||||
Endif
|
||||
|
||||
End
|
||||
|
||||
Public Function SignedDoublePrecision(Lenght As Integer, Optional Decimals As Integer) As String 'Range: -1.7976931348623157E+308 to -2.2250738585072014E-308 and 0
|
||||
|
||||
Return SignedDouble(Lenght, Decimals)
|
||||
|
||||
End
|
||||
|
||||
Public Function UnsignedDoublePrecision(Lenght As Integer, Optional Decimals As Integer) As String 'Range: 2.2250738585072014E-308 to 1.7976931348623157E+308 and 0
|
||||
|
||||
Return UnsignedDouble(Lenght, Decimals)
|
||||
|
||||
End
|
||||
|
||||
Public Function SignedReal(Lenght As Integer, Optional Decimals As Integer) As String 'Range: -1.7976931348623157E+308 to -2.2250738585072014E-308 and 0
|
||||
|
||||
Return SignedDouble(Lenght, Decimals)
|
||||
|
||||
End
|
||||
|
||||
Public Function UnsignedReal(Lenght As Integer, Optional Decimals As Integer) As String 'Range: 2.2250738585072014E-308 to 1.7976931348623157E+308 and 0
|
||||
|
||||
Return UnsignedDouble(Lenght, Decimals)
|
||||
|
||||
End
|
||||
|
||||
Public Function SignedDecimal(Lenght As Integer, Optional Decimals As Integer) As String 'Range: M = 0 to M = 65, D = 0 to D = 30
|
||||
|
||||
If Decimals Then
|
||||
Return "DECIMAL(" & Lenght & "," & Decimals & ")"
|
||||
Else
|
||||
Return "DECIMAL(" & Lenght & ")"
|
||||
Endif
|
||||
|
||||
End
|
||||
|
||||
Public Function UnsignedDecimal(Lenght As Integer, Optional Decimals As Integer) As String 'Range: M = 0 to M = 65, D = 0 to D = 30
|
||||
|
||||
If Decimals Then
|
||||
Return "DECIMAL(" & Lenght & "," & Decimals & ") UNSIGNED"
|
||||
Else
|
||||
Return "DECIMAL(" & Lenght & ") UNSIGNED"
|
||||
Endif
|
||||
|
||||
End
|
||||
|
||||
Public Function SignedDec(Lenght As Integer, Optional Decimals As Integer) As String 'Range: M = 0 to M = 65, D = 0 to D = 30
|
||||
|
||||
Return SignedDecimal(Lenght, Decimals)
|
||||
|
||||
End
|
||||
|
||||
Public Function UnsignedDec(Lenght As Integer, Optional Decimals As Integer) As String 'Range: M = 0 to M = 65, D = 0 to D = 30
|
||||
|
||||
Return UnsignedDecimal(Lenght, Decimals)
|
||||
|
||||
End
|
||||
|
||||
Public Function Year(Optional Lenght As Integer) As String 'In four-digit format, the allowable values are 1901 to 2155, and 0000. In two-digit Format, the allowable values are 70 To 69, representing years From 1970 To 2069.
|
||||
|
||||
Select (Lenght)
|
||||
Case 2, 4
|
||||
Return "YEAR(" & Lenght & ")"
|
||||
Case 0
|
||||
Return "YEAR"
|
||||
End Select
|
||||
|
||||
End
|
||||
|
||||
Public Function Char(Optional Lenght As Integer, Optional CharSet As String, Optional Collation As String) As String 'Range: 0 to 255
|
||||
|
||||
If Lenght Then
|
||||
Return "CHAR(" & Lenght & ") " & CharSet & " " & Collation
|
||||
Else
|
||||
Return "CHAR(1) " & CharSet & " " & Collation
|
||||
Endif
|
||||
|
||||
End
|
||||
|
||||
Public Function VarChar(Lenght As Integer, Optional CharSet As String, Optional Collation As String) As String 'Range: 0 to 65.535
|
||||
|
||||
Return "VARCHAR(" & Lenght & ") " & CharSet & " " & Collation
|
||||
|
||||
End
|
||||
|
||||
Public Function Binary(Lenght As Integer) As String 'Range: 0 to 255
|
||||
|
||||
Return "BINARY(" & Lenght & ")"
|
||||
|
||||
End
|
||||
|
||||
Public Function VarBinary(Lenght As Integer) As String 'Range: 0 to 65.535
|
||||
|
||||
Return "VARBINARY(" & Lenght & ")"
|
||||
|
||||
End
|
||||
|
||||
Public Function TinyText(Optional Lenght As Integer, Optional CharSet As String, Optional Collation As String) As String 'Range: 0 to 255
|
||||
|
||||
Return "TINYTEXT(" & Lenght & ") " & CharSet & " " & Collation
|
||||
|
||||
End
|
||||
|
||||
Public Function Blob(Optional Lenght As Integer) As String 'Range: 1 to 65.535 bytes
|
||||
|
||||
Return "BLOB(" & Lenght & ")"
|
||||
|
||||
End
|
||||
|
||||
Public Function Text(Optional Lenght As Integer, Optional CharSet As String, Optional Collation As String) As String 'Range: 0 to 65.535
|
||||
|
||||
Return "TEXT(" & Lenght & ") " & CharSet & " " & Collation
|
||||
|
||||
End
|
||||
|
||||
Public Function MediumText(Optional CharSet As String, Optional Collation As String) As String 'Max: 16,777,215 (2^24 – 1) characters
|
||||
|
||||
Return "MEDIUMTEXT " & CharSet & " " & Collation
|
||||
|
||||
End
|
||||
|
||||
Public Function LongText(Optional CharSet As String, Optional Collation As String) As String 'Max: 4,294,967,295 or 4GB (2^32 – 1) characters
|
||||
|
||||
Return "LONGTEXT " & CharSet & " " & Collation
|
||||
|
||||
End
|
||||
|
||||
Public Function Enum(Values As String[], Optional CharSet As String, Optional Collation As String) As String 'Max: 65,535 distinct values
|
||||
|
||||
Dim $iCounter As Integer
|
||||
|
||||
$Tmp = "ENUM("
|
||||
For $iCounter = 0 To Values.Count - 1
|
||||
$Tmp &= "'" & Values[$iCounter] & "', "
|
||||
Next
|
||||
$Tmp = Mid($Tmp, 1, Len($Tmp) - 2) 'Strips the last two characters
|
||||
$Tmp &= ")"
|
||||
Return $Tmp
|
||||
|
||||
End
|
||||
|
||||
Public Function Set(Values As String[], Optional CharSet As String, Optional Collation As String) As String 'Max: 64 members
|
||||
|
||||
Dim $iCounter As Integer
|
||||
|
||||
$Tmp = "SET("
|
||||
For $iCounter = 0 To Values.Count - 1
|
||||
$Tmp &= "'" & Values[$iCounter] & "', "
|
||||
Next
|
||||
$Tmp = Mid($Tmp, 1, Len($Tmp) - 2) 'Strips the last two characters
|
||||
$Tmp &= ")"
|
||||
Return $Tmp
|
||||
|
||||
End
|
||||
'End of DataTypes that requiere arguments
|
50
gb.db.mysql/src/gb.db.mysql/_Field.class
Normal file
50
gb.db.mysql/src/gb.db.mysql/_Field.class
Normal file
|
@ -0,0 +1,50 @@
|
|||
' Gambas class file
|
||||
|
||||
Export
|
||||
Create Static
|
||||
|
||||
Private $sTmp As String
|
||||
|
||||
Public Procedure PrimaryKey(Fields As String[])
|
||||
|
||||
modMain.$PrimaryKey = ", PRIMARY KEY (" & modMain.ArrayToString(Fields, True) & ")"
|
||||
|
||||
End
|
||||
|
||||
Public Procedure Add(Field As String, DataType As String, Optional AceptNull? As Boolean, Optional DefaultValue As Variant, Optional AutoIncrement? As Boolean, Optional OnUpdate As String, Optional Comment As String)
|
||||
|
||||
$sTmp = DB.Quote(Field) & " " & DataType
|
||||
If Not AceptNull? Then $sTmp &= " NOT NULL"
|
||||
If DefaultValue <> Null Then
|
||||
Select (DefaultValue)
|
||||
Case True
|
||||
$sTmp &= " DEFAULT '1'"
|
||||
Case False
|
||||
$sTmp &= " DEFAULT '0'"
|
||||
Case "CURRENT_TIMESTAMP"
|
||||
$sTmp &= " DEFAULT CURRENT_TIMESTAMP"
|
||||
Default
|
||||
$sTmp &= " DEFAULT '" & DefaultValue & "'"
|
||||
End Select
|
||||
Endif
|
||||
If AutoIncrement? Then $sTmp &= " AUTO_INCREMENT"
|
||||
If OnUpdate Then $sTmp &= " ON UPDATE " & OnUpdate
|
||||
If Comment Then $sTmp &= " COMMENT '" & Comment & "'"
|
||||
modMain.$FieldDefinition.Add($sTmp)
|
||||
|
||||
End
|
||||
|
||||
Public Procedure Index(Index As String, Field As String)
|
||||
|
||||
modMain.$Index.Add("INDEX " & DB.Quote(Index) & " (" & DB.Quote(Field) & ")")
|
||||
|
||||
End
|
||||
|
||||
Public Procedure ForeignKey(Field As String, RefTable As String, RefField As String, Optional OnDelete As String, Optional OnUpdate As String)
|
||||
|
||||
$sTmp = "FOREIGN KEY (" & DB.Quote(Field) & ") REFERENCES " & DB.Quote(RefTable) & "(" & DB.Quote(RefField) & ")"
|
||||
If OnDelete Then $sTmp &= " ON DELETE " & OnDelete
|
||||
If OnUpdate Then $sTmp &= " ON UPDATE " & OnUpdate
|
||||
modMain.$ForeignKey.Add($sTmp)
|
||||
|
||||
End
|
21
gb.db.mysql/src/gb.db.mysql/_Index.class
Normal file
21
gb.db.mysql/src/gb.db.mysql/_Index.class
Normal file
|
@ -0,0 +1,21 @@
|
|||
' Gambas class file
|
||||
|
||||
Export
|
||||
Create Static
|
||||
|
||||
Public Procedure Add(Index As String, Columns As String[], Optional Table As String)
|
||||
|
||||
If Table Then
|
||||
modMain.$Query = "CREATE INDEX " & DB.Quote(Index) & " ON " & DB.Quote(Table) & " (" & modMain.ArrayToString(Columns, True) & ")"
|
||||
modMain.RunQuery(modMain.$Query)
|
||||
Else
|
||||
modMain.$Index.Add("INDEX " & DB.Quote(Index) & " (" & modMain.ArrayToString(Columns, True) & ")")
|
||||
Endif
|
||||
|
||||
End
|
||||
|
||||
Public Procedure Delete(Table As String, Index As String)
|
||||
|
||||
modMain.RunQuery("DROP INDEX " & DB.Quote(Index) & " ON " & DB.Quote(Table))
|
||||
|
||||
End
|
151
gb.db.mysql/src/gb.db.mysql/_MySQL.class
Normal file
151
gb.db.mysql/src/gb.db.mysql/_MySQL.class
Normal file
|
@ -0,0 +1,151 @@
|
|||
' Gambas class file
|
||||
|
||||
Export
|
||||
|
||||
Private $hResultQuery As Result
|
||||
Private $Engine As String = "InnoDB" 'Engines: InnoDB, MyISAM, Memory, Merge, Archive, Federated, NDB, CSV, Blackhole, Example
|
||||
Private $CharSet As String = "utf8"
|
||||
Private $Collation As String = "utf8_general_ci"
|
||||
Private $sTmp As String
|
||||
Private $DataTypes As _DataTypes
|
||||
Private $DataBase As _DataBase
|
||||
Private $Table As _Table
|
||||
Private $Index As _Index
|
||||
Private $Field As _Field
|
||||
Private $View As _View
|
||||
|
||||
Property Engine As String
|
||||
Property CharSet As String
|
||||
Property Collation As String
|
||||
Property Read DataTypes As _DataTypes
|
||||
Property Read DataBase As _DataBase
|
||||
Property Read Index As _Index
|
||||
Property Read Table As _Table
|
||||
Property Read Field As _Field
|
||||
Property Read View As _View
|
||||
Property Confirm As Boolean
|
||||
|
||||
Public Sub _new(hCon As Connection)
|
||||
|
||||
If hCon.Type <> "mysql" Then Error.Raise(("Not a MySQL connection."))
|
||||
modMain.$Connection = hCon
|
||||
|
||||
End
|
||||
|
||||
Private Function Engine_Read() As String
|
||||
|
||||
Return $Engine
|
||||
|
||||
End
|
||||
|
||||
Private Sub Engine_Write(Value As String)
|
||||
|
||||
$Engine = Value
|
||||
|
||||
End
|
||||
|
||||
Private Function CharSet_Read() As String
|
||||
|
||||
Return $CharSet
|
||||
|
||||
End
|
||||
|
||||
Private Sub CharSet_Write(Value As String) 'Validate if the Char Set is valid
|
||||
|
||||
Dim iCounter As Integer
|
||||
Dim csCharSets As New Collection
|
||||
|
||||
$hResultQuery = modMain.$Connection.Exec("SELECT CHARACTER_SET_NAME FROM information_schema.CHARACTER_SETS")
|
||||
For iCounter = 0 To $hResultQuery.Count - 1
|
||||
csCharSets[iCounter] = $hResultQuery["CHARACTER_SET_NAME"]
|
||||
$hResultQuery.MoveNext()
|
||||
Next
|
||||
For Each $sTmp In csCharSets
|
||||
If $sTmp = Value Then
|
||||
$CharSet = Value
|
||||
Return
|
||||
Endif
|
||||
Next
|
||||
Error.Raise(("Character Set not valid."))
|
||||
|
||||
End
|
||||
|
||||
Private Function Collation_Read() As String
|
||||
|
||||
Return $Collation
|
||||
|
||||
End
|
||||
|
||||
Private Sub Collation_Write(Value As String)
|
||||
|
||||
Dim iCounter As Integer
|
||||
Dim csCharSets As New Collection
|
||||
|
||||
$hResultQuery = modMain.$Connection.Exec("SELECT COLLATION_NAME FROM information_schema.COLLATIONS")
|
||||
For iCounter = 0 To $hResultQuery.Count - 1
|
||||
csCharSets[iCounter] = $hResultQuery["COLLATION_NAME"]
|
||||
$hResultQuery.MoveNext()
|
||||
Next
|
||||
For Each $sTmp In csCharSets
|
||||
If $sTmp = Value Then
|
||||
$Collation = Value
|
||||
Return
|
||||
Endif
|
||||
Next
|
||||
Error.Raise(("Collation not valid."))
|
||||
|
||||
End
|
||||
|
||||
Private Function DataTypes_Read() As _DataTypes
|
||||
|
||||
$DataTypes = New _DataTypes
|
||||
Return $DataTypes
|
||||
|
||||
End
|
||||
|
||||
Private Function DataBase_Read() As _DataBase
|
||||
|
||||
$DataBase = New _DataBase
|
||||
Return $DataBase
|
||||
|
||||
End
|
||||
|
||||
Private Function Index_Read() As _Index
|
||||
|
||||
$Index = New _Index
|
||||
Return $Index
|
||||
|
||||
End
|
||||
|
||||
Private Function Table_Read() As _Table
|
||||
|
||||
$Table = New _Table
|
||||
Return $Table
|
||||
|
||||
End
|
||||
|
||||
Private Function Field_Read() As _Field
|
||||
|
||||
$Field = New _Field
|
||||
Return $Field
|
||||
|
||||
End
|
||||
|
||||
Private Function Confirm_Read() As Boolean
|
||||
|
||||
Return modMain.$Confirm
|
||||
|
||||
End
|
||||
|
||||
Private Sub Confirm_Write(Value As Boolean)
|
||||
|
||||
modMain.$Confirm = Value
|
||||
|
||||
End
|
||||
|
||||
Private Function View_Read() As _View
|
||||
|
||||
$View = New _View
|
||||
Return $View
|
||||
|
||||
End
|
53
gb.db.mysql/src/gb.db.mysql/_Table.class
Normal file
53
gb.db.mysql/src/gb.db.mysql/_Table.class
Normal file
|
@ -0,0 +1,53 @@
|
|||
' Gambas class file
|
||||
|
||||
Export
|
||||
Create Static
|
||||
|
||||
Public Procedure Modify(Table As String, Action As String, Optional Symbol As String, Optional Definition As String)
|
||||
|
||||
Action = Upper(Action)
|
||||
If (Not ((Action = "DROP") Or (Action = "ADD") Or (Action = "MODIFY") Or (Action = "CHANGE"))) Then Error.Raise(("Action no allowed."))
|
||||
modMain.$Query = "ALTER TABLE " & DB.Quote(Table) & " " & Action & " " & DB.Quote(Symbol)
|
||||
If Definition Then modMain.$Query &= " " & Definition
|
||||
modMain.RunQuery(modMain.$Query)
|
||||
|
||||
End
|
||||
|
||||
Public Procedure Add(Table As String, Optional Engine As String, Optional CharSet As String)
|
||||
|
||||
'Construc the table statement
|
||||
modMain.$Query = "CREATE TABLE " & DB.Quote(Table) & " ("
|
||||
modMain.$Query &= modMain.ArrayToString(modMain.$FieldDefinition, False)
|
||||
If modMain.$PrimaryKey Then modMain.$Query &= modMain.$PrimaryKey
|
||||
If modMain.$Index.Count Then modMain.$Query &= ", " & modMain.ArrayToString(modMain.$Index, False)
|
||||
If modMain.$ForeignKey.Count Then modMain.$Query &= ", " & modMain.ArrayToString(modMain.$ForeignKey, False)
|
||||
modMain.$Query &= ")"
|
||||
If Engine Then modMain.$Query &= " ENGINE = " & Engine
|
||||
If CharSet Then modMain.$Query &= " DEFAULT CHARSET = " & CharSet
|
||||
|
||||
'Clears all the information from this table to be ready for the next one
|
||||
modMain.$FieldDefinition.Clear()
|
||||
modMain.$PrimaryKey = Null
|
||||
modMain.$ForeignKey.Clear()
|
||||
modMain.$Index.Clear()
|
||||
|
||||
'Runs the query
|
||||
modMain.RunQuery(modMain.$Query)
|
||||
|
||||
End
|
||||
|
||||
Public Procedure Delete(Tables As String[], IfExists As Boolean)
|
||||
|
||||
modMain.$Query = "DROP TABLE "
|
||||
If IfExists Then modMain.$Query &= "IF EXISTS "
|
||||
modMain.$Query &= modMain.ArrayToString(Tables, True)
|
||||
modMain.RunQuery(modMain.$Query)
|
||||
|
||||
End
|
||||
|
||||
Public Procedure LoadData(Table As String, File As String)
|
||||
|
||||
modMain.$Query = "LOAD DATA LOCAL INFILE '" & File & "' INTO TABLE " & Table
|
||||
modMain.RunQuery(modMain.$Query)
|
||||
|
||||
End
|
29
gb.db.mysql/src/gb.db.mysql/_View.class
Normal file
29
gb.db.mysql/src/gb.db.mysql/_View.class
Normal file
|
@ -0,0 +1,29 @@
|
|||
' Gambas class file
|
||||
|
||||
Export
|
||||
Create Static
|
||||
|
||||
Public Procedure Modify(View As String, Statement As String)
|
||||
|
||||
Add(View, Statement, True)
|
||||
|
||||
End
|
||||
|
||||
Public Procedure Add(View As String, Statement As String, Optional {Replace} As Boolean)
|
||||
|
||||
'TODO: Quote the Statement parameter
|
||||
modMain.$Query = "CREATE"
|
||||
If {Replace} Then modMain.$Query &= " OR REPLACE"
|
||||
modMain.$Query &= " VIEW " & DB.Quote(View) & " AS " & Statement
|
||||
modMain.RunQuery(modMain.$Query)
|
||||
|
||||
End
|
||||
|
||||
Public Procedure Delete(Views As String[], IfExists As Boolean)
|
||||
|
||||
modMain.$Query = "DROP VIEW "
|
||||
If IfExists Then modMain.$Query &= "IF EXISTS "
|
||||
modMain.$Query &= modMain.ArrayToString(Views, True)
|
||||
modMain.RunQuery(modMain.$Query)
|
||||
|
||||
End
|
46
gb.db.mysql/src/gb.db.mysql/modMain.module
Normal file
46
gb.db.mysql/src/gb.db.mysql/modMain.module
Normal file
|
@ -0,0 +1,46 @@
|
|||
' Gambas module file
|
||||
|
||||
Public $Query As String
|
||||
Public $NotNULL As Boolean = True
|
||||
Public $FieldDefinition As New String[]
|
||||
Public $Index As New String[]
|
||||
Public $ForeignKey As New String[]
|
||||
Public $PrimaryKey As String
|
||||
Public $Connection As New Connection
|
||||
Public $Confirm As Boolean = False
|
||||
Public $Process As Process
|
||||
|
||||
Public Function ArrayToString(Array As String[], Quote As Boolean) As String
|
||||
|
||||
Dim $iCounter As Integer
|
||||
Dim $Tmp As String
|
||||
|
||||
For $iCounter = 0 To Array.Count - 1
|
||||
If Quote Then
|
||||
$Tmp &= DB.Quote(Array[$iCounter]) & ", "
|
||||
Else
|
||||
$Tmp &= Array[$iCounter] & ", "
|
||||
Endif
|
||||
Next
|
||||
$Tmp = Mid($Tmp, 1, Len($Tmp) - 2) 'Strips the last two characters
|
||||
Return $Tmp
|
||||
|
||||
End
|
||||
|
||||
Public Procedure RunQuery(Query As String)
|
||||
|
||||
If $Confirm Then
|
||||
If Message.Question(("Do you really want to execute the following statement?") & GB.NewLine & Query, ("&Yes"), ("&No")) = 1 Then $Connection.Exec(Query)
|
||||
Else
|
||||
$Connection.Exec(Query)
|
||||
Endif
|
||||
Catch
|
||||
Error.Raise(Error.Text)
|
||||
|
||||
End
|
||||
|
||||
Public Sub Main()
|
||||
|
||||
|
||||
|
||||
End
|
|
@ -255,7 +255,7 @@ static char* aux_get_target_from_action(LinkAction *act)
|
|||
tmp=((LinkNamed*)act)->getName(); break;
|
||||
|
||||
case actionMovie:
|
||||
#ifdef POPPLER_VERSION_0_8
|
||||
#if POPPLER_VERSION_0_8
|
||||
tmp=((LinkMovie*)act)->getAnnotTitle(); break;
|
||||
#else
|
||||
tmp=((LinkMovie*)act)->getTitle(); break;
|
||||
|
|
|
@ -3,6 +3,7 @@ Key=gb.qt4.ext
|
|||
Author=Nigel Gerrard,Benoît Minisini
|
||||
Type=Form
|
||||
Require=gb.qt4
|
||||
State=2
|
||||
|
||||
[Form]
|
||||
Controls=LCDNumber,Dial,Editor,TextEdit
|
||||
|
|
|
@ -3,6 +3,7 @@ Key=gb.qt4
|
|||
Author=Benoît Minisini
|
||||
Implements=Form,EventLoop,ImageProvider
|
||||
Type=Form
|
||||
State=2
|
||||
|
||||
[Form]
|
||||
Control=Label,TextLabel,Separator,PictureBox,MovieBox,ProgressBar
|
||||
|
|
|
@ -4,6 +4,7 @@ Author=Laurent Carlier
|
|||
Require=gb.qt4
|
||||
Type=Form
|
||||
Implement=OpenGLViewer
|
||||
State=2
|
||||
|
||||
[Special]
|
||||
Control=GlArea
|
||||
|
|
|
@ -415,8 +415,9 @@ static bool analyze_native_component(const char *path)
|
|||
}
|
||||
else
|
||||
{
|
||||
warning("cannot find '" LIB_CLASS "' symbol in shared library.");
|
||||
ret = TRUE;
|
||||
if (_verbose)
|
||||
warning("cannot find '" LIB_CLASS "' symbol in shared library.");
|
||||
//ret = TRUE;
|
||||
}
|
||||
|
||||
// Do not close shared libraries
|
||||
|
|
Loading…
Reference in a new issue