Commit 2a7ab4d9 authored by Bruce Momjian's avatar Bruce Momjian

Update to pgaccess 0.98.7.

parent 7fcd675d
...@@ -22,7 +22,7 @@ PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. ...@@ -22,7 +22,7 @@ PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
PGACCESS 0.98.4 29 January 2000 PGACCESS 0.98.7 27 January 2001
================================ ================================
I dedicate this program to my little daughters Ana-Maria and Emilia and to my I dedicate this program to my little daughters Ana-Maria and Emilia and to my
wife for their understanding. I hope they will forgive me for spending so many wife for their understanding. I hope they will forgive me for spending so many
...@@ -32,8 +32,7 @@ time far from them. ...@@ -32,8 +32,7 @@ time far from them.
1. How to INSTALL ? 1. How to INSTALL ?
You will need a Tcl/Tk package, at least Tcl 7.6 and Tk 4.2, recommended You will need a Tcl/Tk package greater than 8.0
Tcl/Tk 8.x
For Unix users, unpack the pgaccess-xxx.tar.gz archieve in you preferred For Unix users, unpack the pgaccess-xxx.tar.gz archieve in you preferred
directory (usually /usr/local). directory (usually /usr/local).
......
CREATE SEQUENCE "cities_id_seq" start 7 increment 1 maxvalue 2147483647 minvalue 1 cache 1 ; CREATE SEQUENCE "cities_id_seq" start 7 increment 1 maxvalue 2147483647 minvalue 1 cache 1 ;
SELECT nextval ('cities_id_seq'); SELECT nextval ('"cities_id_seq"');
CREATE TABLE "pga_queries" ( CREATE TABLE "pga_queries" (
"queryname" character varying(64), "queryname" character varying(64),
"querytype" character, "querytype" character,
...@@ -7,41 +7,50 @@ CREATE TABLE "pga_queries" ( ...@@ -7,41 +7,50 @@ CREATE TABLE "pga_queries" (
"querytables" text, "querytables" text,
"querylinks" text, "querylinks" text,
"queryresults" text, "queryresults" text,
"querycomments" text); "querycomments" text
);
CREATE TABLE "pga_forms" ( CREATE TABLE "pga_forms" (
"formname" character varying(64), "formname" character varying(64),
"formsource" text); "formsource" text
);
CREATE TABLE "pga_scripts" ( CREATE TABLE "pga_scripts" (
"scriptname" character varying(64), "scriptname" character varying(64),
"scriptsource" text); "scriptsource" text
);
CREATE TABLE "pga_reports" ( CREATE TABLE "pga_reports" (
"reportname" character varying(64), "reportname" character varying(64),
"reportsource" text, "reportsource" text,
"reportbody" text, "reportbody" text,
"reportprocs" text, "reportprocs" text,
"reportoptions" text); "reportoptions" text
);
CREATE TABLE "phonebook" ( CREATE TABLE "phonebook" (
"name" character varying(32), "name" character varying(32),
"phone_nr" character varying(16), "phone_nr" character varying(16),
"city" character varying(32), "city" character varying(32),
"company" bool, "company" bool,
"continent" character varying(16)); "continent" character varying(16)
);
CREATE TABLE "pga_layout" ( CREATE TABLE "pga_layout" (
"tablename" character varying(64), "tablename" character varying(64),
"nrcols" int2, "nrcols" int2,
"colnames" text, "colnames" text,
"colwidth" text); "colwidth" text
);
CREATE TABLE "pga_schema" ( CREATE TABLE "pga_schema" (
"schemaname" character varying(64), "schemaname" character varying(64),
"schematables" text, "schematables" text,
"schemalinks" text); "schemalinks" text
);
REVOKE ALL on "pga_schema" from PUBLIC; REVOKE ALL on "pga_schema" from PUBLIC;
GRANT ALL on "pga_schema" to PUBLIC; GRANT ALL on "pga_schema" to PUBLIC;
CREATE TABLE "cities" ( CREATE TABLE "cities" (
"id" int4 DEFAULT nextval ( '"cities_id_seq"' ) NOT NULL, "id" int4 DEFAULT nextval('cities_id_seq'::text) NOT NULL,
"name" character varying(32) NOT NULL, "name" character varying(32) NOT NULL,
"prefix" character varying(16) NOT NULL); "prefix" character varying(16) NOT NULL
);
REVOKE ALL on "cities" from PUBLIC; REVOKE ALL on "cities" from PUBLIC;
GRANT INSERT,SELECT,RULE on "cities" to "teo";
CREATE FUNCTION "getcityprefix" (int4 ) RETURNS varchar AS 'select prefix from cities where id = $1 ' LANGUAGE 'SQL'; CREATE FUNCTION "getcityprefix" (int4 ) RETURNS varchar AS 'select prefix from cities where id = $1 ' LANGUAGE 'SQL';
COPY "pga_queries" FROM stdin; COPY "pga_queries" FROM stdin;
Query that can be saved as view S select * from phonebook where continent='usa' \N \N \N \N Query that can be saved as view S select * from phonebook where continent='usa' \N \N \N \N
......
...@@ -10,30 +10,11 @@ ...@@ -10,30 +10,11 @@
Download</h2> Download</h2>
<hr> <hr>
<br>The primary site for PgAccess downloads is: <br>The primary site for PgAccess download is:
<ul><a href="ftp://ftp.flex.ro/pub/pgaccess">ftp://ftp.flex.ro/pub/pgaccess</a> <ul><a href="ftp://ftp.flex.ro/pub/pgaccess">ftp://ftp.flex.ro/pub/pgaccess</a>
<ul> <ul>
<li> <li><a href="ftp://ftp.flex.ro/pub/pgaccess/pgaccess-0.98.7.tar.gz">Unix tar.gz file</a></li>
<a href="ftp://ftp.flex.ro/pub/pgaccess/pgaccess-0.98.5.tar.gz">Unix tar.gz <li><a href="ftp://ftp.flex.ro/pub/pgaccess/pgaccess-0.98.7.zip">Windows ZIP file</a></li>
file</a></li>
<li>
<a href="ftp://ftp.flex.ro/pub/pgaccess/pgaccess-0.98.5.zip">Windows .zip
file</a></li>
</ul>
</ul>
<p>Another one (just with a little bit faster, try this one first) would
be :
<ul><a href="ftp://speedy.flex.ro/pub/pgaccess">ftp://speedy.flex.ro/pub/pgaccess</a>
<ul>
<li>
<a href="ftp://speedy.flex.ro/pub/pgaccess/pgaccess-0.98.5.tar.gz">Unix tar.gz
file</a></li>
<li>
<a href="ftp://speedy.flex.ro/pub/pgaccess/pgaccess-0.98.5.zip">Windows .zip
file</a></li>
</ul> </ul>
</ul> </ul>
......
...@@ -14,7 +14,7 @@ PgAccess has been written by <a href="mailto:teo@flex.ro">Constantin Teodorescu< ...@@ -14,7 +14,7 @@ PgAccess has been written by <a href="mailto:teo@flex.ro">Constantin Teodorescu<
using Visual Tcl, the best tool for developing Tcl/Tk applications I've using Visual Tcl, the best tool for developing Tcl/Tk applications I've
ever seen. ever seen.
<p><b>Last version</b> <p><b>Last version</b>
<br>Last stable version is 0.98.5 , released on 30 March 2000. Read <a href="whatsnew.html">what's <br>Last stable version is 0.98.7 , released on 27 January 2001. Read <a href="whatsnew.html">what's
new</a> . new</a> .
<p><b>Portability issues</b> <p><b>Portability issues</b>
<br>PgAccess is available for every platform where PostgreSQL was ported <br>PgAccess is available for every platform where PostgreSQL was ported
...@@ -27,9 +27,7 @@ on : ...@@ -27,9 +27,7 @@ on :
<br>- HPUX <br>- HPUX
<br>- Irix <br>- Irix
<br>- Windows 95,98,NT <br>- Windows 95,98,NT
<p>PgAccess needs Tcl/Tk versions 8.0.x and higher thought PgAccess. For <p>PgAccess needs Tcl/Tk versions 8.0.x and higher. For win32 platforms there are some special DLL's that have to be downloaded and installed, more information <a href="win32.html">here</a>.
win32 platforms there are some special DLL's that have to be downloaded
and installed, more information <a href="win32.html">here</a>.
<p>PgAccess is protected by the following <a href="copyright.html">copyright</a>. <p>PgAccess is protected by the following <a href="copyright.html">copyright</a>.
</body> </body>
</html> </html>
...@@ -5,6 +5,24 @@ ...@@ -5,6 +5,24 @@
<meta name="GENERATOR" content="Mozilla/4.72 [en] (X11; I; Linux 2.2.14 i586) [Netscape]"> <meta name="GENERATOR" content="Mozilla/4.72 [en] (X11; I; Linux 2.2.14 i586) [Netscape]">
</head> </head>
<body bgcolor="#FEFEDF"> <body bgcolor="#FEFEDF">
<b>27 January 2001 - PgAccess 0.98.7</b>
<ul>
<li>
Fixed table creation when all columns are inherited and no new columns are added
</li>
<li>
Geometry improvements in diagram definition
</li>
<li>
added DLL's for Win32, Tcl/Tk 8.3.x and PostgreSQL 7.x
</li>
</ul>
<b>1 May 2000 - PgAccess 0.98.6</b>
<ul>
<li>
fixed a ugly bug in forms, query opening procedure</li>
</ul>
<b>30 March 2000 - PgAccess 0.98.5</b> <b>30 March 2000 - PgAccess 0.98.5</b>
<ul> <ul>
<li> <li>
......
...@@ -803,6 +803,7 @@ switch $PgAcVar(fdobj,$item,class) { ...@@ -803,6 +803,7 @@ switch $PgAcVar(fdobj,$item,class) {
set DataControlVar($base.$name,recno) 0 set DataControlVar($base.$name,recno) 0
set DataControlVar($base.$name,nrecs) \[pg_result \$res -numTuples\] set DataControlVar($base.$name,nrecs) \[pg_result \$res -numTuples\]
setCursor NORMAL setCursor NORMAL
pg_result \$res -clear
}" }"
namespace eval ::DataControl($base.$name) "proc setSQL {sqlcmd} { namespace eval ::DataControl($base.$name) "proc setSQL {sqlcmd} {
global DataControlVar global DataControlVar
......
...@@ -18,7 +18,7 @@ CREATE DATABASE name \[ WITH LOCATION = 'dbpath' \] ...@@ -18,7 +18,7 @@ CREATE DATABASE name \[ WITH LOCATION = 'dbpath' \]
" {} "CREATEDB" {italic} " " {} "CREATEDB" {italic} "
Message returned if the command completes successfully. Message returned if the command completes successfully.
" {} "NOTICE: createdb: database \"name\" already exists." {italic} " " {} "WARN: createdb: database \"name\" already exists." {italic} "
This occurs if database specified already exists. This occurs if database specified already exists.
" {} "ERROR: Unable to create database directory directory" {italic} " " {} "ERROR: Unable to create database directory directory" {italic} "
......
...@@ -17,7 +17,7 @@ VACUUM \[ VERBOSE \] ANALYZE \[ table \[ (column \[, ...\] ) \] \] ...@@ -17,7 +17,7 @@ VACUUM \[ VERBOSE \] ANALYZE \[ table \[ (column \[, ...\] ) \] \]
Prints a detailed vacuum activity report for each table. Prints a detailed vacuum activity report for each table.
" {} "ANALYZE" {italic} " " {} "ANALYZE" {italic} "
Updates column statistics used by the optimizer to determine the most efficient way to execute a query. The statistics represent the dispersion of the data in each column. This information is valuable when several execution paths are possible. Updates column statistics used by the optimizer to determine the most efficient way to execute a query. The statistics represent the disbursion of the data in each column. This information is valuable when several execution paths are possible.
" {} "table" {italic} " " {} "table" {italic} "
The name of a specific table to vacuum. Defaults to all tables. The name of a specific table to vacuum. Defaults to all tables.
......
...@@ -346,7 +346,7 @@ array set Messages { ...@@ -346,7 +346,7 @@ array set Messages {
"File" "Soubor" "File" "Soubor"
"Your table has no fields!" "Tabulka nem poloky!" "Your table has no columns!" "Tabulka nem poloky!"
"Height" "Vka" "Height" "Vka"
......
...@@ -346,7 +346,7 @@ array set Messages { ...@@ -346,7 +346,7 @@ array set Messages {
"File" "Datei" "File" "Datei"
"Your table has no fields!" "Die Tabelle hat keine Felder." "Your table has no columns!" "Die Tabelle hat keine Felder."
"Height" "Hhe" "Height" "Hhe"
......
This diff is collapsed.
...@@ -348,7 +348,7 @@ array set Messages { ...@@ -348,7 +348,7 @@ array set Messages {
"File" "File" "File" "File"
"Your table has no fields!" "La tabella non ha campi !" "Your table has no columns!" "La tabella non ha campi !"
"Height" "Altezza" "Height" "Altezza"
......
...@@ -347,7 +347,7 @@ hiba ...@@ -347,7 +347,7 @@ hiba
"File" "Fjl" "File" "Fjl"
"Your table has no fields!" "A tblban nincsenek mezk!" "Your table has no columns!" "A tblban nincsenek mezk!"
"Height" "Magassg" "Height" "Magassg"
......
...@@ -348,7 +348,7 @@ array set Messages { ...@@ -348,7 +348,7 @@ array set Messages {
"File" "Arquivo" "File" "Arquivo"
"Your table has no fields!" "Sua tabela no possui campos !" "Your table has no columns!" "Sua tabela no possui campos !"
"Height" "Altura" "Height" "Altura"
......
...@@ -346,7 +346,7 @@ array set Messages { ...@@ -346,7 +346,7 @@ array set Messages {
"File" "Fiier" "File" "Fiier"
"Your table has no fields!" "Tabela asta nu are nici un cimp ?" "Your table has no columns!" "Tabela asta nu are nici un cimp ?"
"Height" "nlime" "Height" "nlime"
......
...@@ -347,7 +347,7 @@ array set Messages { ...@@ -347,7 +347,7 @@ array set Messages {
"File" "" "File" ""
"Your table has no fields!" " !" "Your table has no columns!" " !"
"Height" "" "Height" ""
......
...@@ -346,7 +346,7 @@ array set Messages { ...@@ -346,7 +346,7 @@ array set Messages {
"File" "" "File" ""
"Your table has no fields!" " !" "Your table has no columns!" " !"
"Height" "" "Height" ""
......
...@@ -372,7 +372,7 @@ formulario en la Base de Datos?" ...@@ -372,7 +372,7 @@ formulario en la Base de Datos?"
"File" "Archivo" "File" "Archivo"
"Your table has no fields!" "La tabla no tiene campos!" "Your table has no columns!" "La tabla no tiene campos!"
"Height" "Alto" "Height" "Alto"
......
...@@ -903,7 +903,7 @@ proc vTclWindow.pgaw:About {base} { ...@@ -903,7 +903,7 @@ proc vTclWindow.pgaw:About {base} {
wm title $base [intlmsg "About"] wm title $base [intlmsg "About"]
label $base.l1 -borderwidth 3 -font -Adobe-Helvetica-Bold-R-Normal-*-*-180-*-*-*-*-* -relief ridge -text PgAccess label $base.l1 -borderwidth 3 -font -Adobe-Helvetica-Bold-R-Normal-*-*-180-*-*-*-*-* -relief ridge -text PgAccess
label $base.l2 -relief groove -text [intlmsg "A Tcl/Tk interface to\nPostgreSQL\nby Constantin Teodorescu"] label $base.l2 -relief groove -text [intlmsg "A Tcl/Tk interface to\nPostgreSQL\nby Constantin Teodorescu"]
label $base.l3 -borderwidth 0 -relief sunken -text {v 0.98.5} label $base.l3 -borderwidth 0 -relief sunken -text {v 0.98.7}
label $base.l4 -relief groove -text "[intlmsg {You will always get the latest version at:}] label $base.l4 -relief groove -text "[intlmsg {You will always get the latest version at:}]
http://www.flex.ro/pgaccess http://www.flex.ro/pgaccess
......
...@@ -104,6 +104,7 @@ global PgAcVar ...@@ -104,6 +104,7 @@ global PgAcVar
} }
option add *Entry.background #fefefe option add *Entry.background #fefefe
option add *Entry.foreground #000000 option add *Entry.foreground #000000
option add *Entry.Font $PgAcVar(pref,font_normal)
option add *Button.BorderWidth 1 option add *Button.BorderWidth 1
} }
......
...@@ -39,6 +39,9 @@ global PgAcVar CurrentDB ...@@ -39,6 +39,9 @@ global PgAcVar CurrentDB
} }
set PgAcVar(schema,links) $links set PgAcVar(schema,links) $links
drawLinks drawLinks
foreach {ulx uly lrx lry} [.pgaw:Schema.c bbox all] {
wm geometry .pgaw:Schema [expr $lrx+30]x[expr $lry+30]
}
} }
...@@ -100,7 +103,7 @@ global PgAcVar ...@@ -100,7 +103,7 @@ global PgAcVar
.pgaw:Schema.c lower rect .pgaw:Schema.c lower rect
drawLinks drawLinks
.pgaw:Schema.c bind mov <Button-1> {Schema::dragStart %W %x %y} .pgaw:Schema.c bind mov <Button-1> {Schema::dragStart %W %x %y %s}
.pgaw:Schema.c bind mov <B1-Motion> {Schema::dragMove %W %x %y} .pgaw:Schema.c bind mov <B1-Motion> {Schema::dragMove %W %x %y}
bind .pgaw:Schema.c <ButtonRelease-1> {Schema::dragStop %x %y} bind .pgaw:Schema.c <ButtonRelease-1> {Schema::dragStop %x %y}
bind .pgaw:Schema <Button-1> {Schema::canvasClick %x %y %W} bind .pgaw:Schema <Button-1> {Schema::canvasClick %x %y %W}
...@@ -152,42 +155,45 @@ set PgAcVar(schema,nexty) $nexty ...@@ -152,42 +155,45 @@ set PgAcVar(schema,nexty) $nexty
proc {deleteObject} {} { proc {deleteObject} {} {
global PgAcVar global PgAcVar
# Checking if there # Checking if there
set obj [.pgaw:Schema.c find withtag hili] set objs [.pgaw:Schema.c find withtag hili]
if {$obj==""} return set numobj [llength $objs]
if {$numobj == 0 } return
# Is object a link ? # Is object a link ?
if {[getTagInfo $obj link]=="s"} { foreach obj $objs {
if {[tk_messageBox -title [intlmsg Warning] -icon question -parent .pgaw:Schema -message [intlmsg "Remove link ?"] -type yesno -default no]=="no"} return if {[getTagInfo $obj link]=="s"} {
set linkid [getTagInfo $obj lkid] if {[tk_messageBox -title [intlmsg Warning] -icon question -parent .pgaw:Schema -message [intlmsg "Remove link ?"] -type yesno -default no]=="no"} return
set PgAcVar(schema,links) [lreplace $PgAcVar(schema,links) $linkid $linkid] set linkid [getTagInfo $obj lkid]
set PgAcVar(schema,links) [lreplace $PgAcVar(schema,links) $linkid $linkid]
.pgaw:Schema.c delete links
drawLinks
return
}
# Is object a table ?
set tablealias [getTagInfo $obj tab]
set tablename $PgAcVar(schema,tablename$tablealias)
if {"$tablename"==""} return
if {[tk_messageBox -title [intlmsg Warning] -icon question -parent .pgaw:Schema -message [format [intlmsg "Remove table %s from schema?"] $tablename] -type yesno -default no]=="no"} return
for {set i [expr [llength $PgAcVar(schema,links)]-1]} {$i>=0} {incr i -1} {
set thelink [lindex $PgAcVar(schema,links) $i]
if {($tablename==[lindex $thelink 0]) || ($tablename==[lindex $thelink 2])} {
set PgAcVar(schema,links) [lreplace $PgAcVar(schema,links) $i $i]
}
}
for {set i 0} {$i<$PgAcVar(schema,ntables)} {incr i} {
set temp {}
catch {set temp $PgAcVar(schema,tablename$i)}
if {"$temp"=="$tablename"} {
unset PgAcVar(schema,tablename$i)
unset PgAcVar(schema,tablestruct$i)
break
}
}
#incr PgAcVar(schema,ntables) -1
.pgaw:Schema.c delete tab$tablealias
.pgaw:Schema.c delete links .pgaw:Schema.c delete links
drawLinks drawLinks
return
}
# Is object a table ?
set tablealias [getTagInfo $obj tab]
set tablename $PgAcVar(schema,tablename$tablealias)
if {"$tablename"==""} return
if {[tk_messageBox -title [intlmsg Warning] -icon question -parent .pgaw:Schema -message [format [intlmsg "Remove table %s from query?"] $tablename] -type yesno -default no]=="no"} return
for {set i [expr [llength $PgAcVar(schema,links)]-1]} {$i>=0} {incr i -1} {
set thelink [lindex $PgAcVar(schema,links) $i]
if {($tablealias==[lindex $thelink 0]) || ($tablealias==[lindex $thelink 2])} {
set PgAcVar(schema,links) [lreplace $PgAcVar(schema,links) $i $i]
} }
} }
for {set i 0} {$i<$PgAcVar(schema,ntables)} {incr i} {
set temp {}
catch {set temp $PgAcVar(schema,tablename$i)}
if {"$temp"=="$tablename"} {
unset PgAcVar(schema,tablename$i)
unset PgAcVar(schema,tablestruct$i)
break
}
}
#incr PgAcVar(schema,ntables) -1
.pgaw:Schema.c delete tab$tablealias
.pgaw:Schema.c delete links
drawLinks
}
proc {dragMove} {w x y} { proc {dragMove} {w x y} {
...@@ -196,7 +202,7 @@ global PgAcVar ...@@ -196,7 +202,7 @@ global PgAcVar
set dx [expr $x - $PgAcVar(draginfo,x)] set dx [expr $x - $PgAcVar(draginfo,x)]
set dy [expr $y - $PgAcVar(draginfo,y)] set dy [expr $y - $PgAcVar(draginfo,y)]
if {$PgAcVar(draginfo,is_a_table)} { if {$PgAcVar(draginfo,is_a_table)} {
$w move $PgAcVar(draginfo,tabletag) $dx $dy $w move dragme $dx $dy
drawLinks drawLinks
} else { } else {
$w move $PgAcVar(draginfo,obj) $dx $dy $w move $PgAcVar(draginfo,obj) $dx $dy
...@@ -206,7 +212,7 @@ global PgAcVar ...@@ -206,7 +212,7 @@ global PgAcVar
} }
proc {dragStart} {w x y} { proc {dragStart} {w x y state} {
global PgAcVar global PgAcVar
PgAcVar:clean draginfo,* PgAcVar:clean draginfo,*
set PgAcVar(draginfo,obj) [$w find closest $x $y] set PgAcVar(draginfo,obj) [$w find closest $x $y]
...@@ -223,8 +229,12 @@ if {[getTagInfo $PgAcVar(draginfo,obj) table]=="header"} { ...@@ -223,8 +229,12 @@ if {[getTagInfo $PgAcVar(draginfo,obj) table]=="header"} {
set taglist [.pgaw:Schema.c gettags $PgAcVar(draginfo,obj)] set taglist [.pgaw:Schema.c gettags $PgAcVar(draginfo,obj)]
set PgAcVar(draginfo,tabletag) [lindex $taglist [lsearch -regexp $taglist "^tab\[0-9\]*"]] set PgAcVar(draginfo,tabletag) [lindex $taglist [lsearch -regexp $taglist "^tab\[0-9\]*"]]
.pgaw:Schema.c raise $PgAcVar(draginfo,tabletag) .pgaw:Schema.c raise $PgAcVar(draginfo,tabletag)
.pgaw:Schema.c itemconfigure [.pgaw:Schema.c find withtag hili] -fill black if {$state == 0} {
.pgaw:Schema.c dtag [.pgaw:Schema.c find withtag hili] hili .pgaw:Schema.c itemconfigure hili -fill black
.pgaw:Schema.c dtag hili
.pgaw:Schema.c dtag dragme
}
.pgaw:Schema.c addtag dragme withtag $PgAcVar(draginfo,tabletag)
.pgaw:Schema.c addtag hili withtag $PgAcVar(draginfo,obj) .pgaw:Schema.c addtag hili withtag $PgAcVar(draginfo,obj)
.pgaw:Schema.c itemconfigure hili -fill blue .pgaw:Schema.c itemconfigure hili -fill blue
} else { } else {
...@@ -247,7 +257,11 @@ if {$este==""} return ...@@ -247,7 +257,11 @@ if {$este==""} return
# Re-establish the normal paint order so # Re-establish the normal paint order so
# information won't be overlapped by table rectangles # information won't be overlapped by table rectangles
# or link lines # or link lines
.pgaw:Schema.c lower $PgAcVar(draginfo,obj) if {$PgAcVar(draginfo,is_a_table)} {
.pgaw:Schema.c lower $PgAcVar(draginfo,tabletag)
} else {
.pgaw:Schema.c lower $PgAcVar(draginfo,obj)
}
.pgaw:Schema.c lower rect .pgaw:Schema.c lower rect
.pgaw:Schema.c lower links .pgaw:Schema.c lower links
set PgAcVar(schema,panstarted) 0 set PgAcVar(schema,panstarted) 0
...@@ -327,26 +341,22 @@ foreach link $PgAcVar(schema,links) { ...@@ -327,26 +341,22 @@ foreach link $PgAcVar(schema,links) {
# Source object is on the left of target object # Source object is on the left of target object
set x1 $sre set x1 $sre
set y1 [expr ([lindex $sbbox 1]+[lindex $sbbox 3])/2] set y1 [expr ([lindex $sbbox 1]+[lindex $sbbox 3])/2]
.pgaw:Schema.c create line $x1 $y1 [expr $x1+10] $y1 \
-tags [subst {links lkid$i}] -width 3
set x2 [lindex $dbbox 0] set x2 [lindex $dbbox 0]
set y2 [expr ([lindex $dbbox 1]+[lindex $dbbox 3])/2] set y2 [expr ([lindex $dbbox 1]+[lindex $dbbox 3])/2]
.pgaw:Schema.c create line [expr $x2-10] $y2 $x2 $y2 \ .pgaw:Schema.c create line $x1 $y1 [expr $x1+10] $y1 \
-tags [subst {links lkid$i}] -width 3 [expr $x1+10] $y1 [expr $x2-10] $y2 \
.pgaw:Schema.c create line [expr $x1+10] $y1 [expr $x2-10] $y2 \ [expr $x2-10] $y2 $x2 $y2 \
-tags [subst {links lkid$i}] -width 2 -tags [subst {links lkid$i}] -width 2
} else { } else {
# source object is on the right of target object # source object is on the right of target object
set x1 [lindex $sbbox 0] set x1 [lindex $sbbox 0]
set y1 [expr ([lindex $sbbox 1]+[lindex $sbbox 3])/2] set y1 [expr ([lindex $sbbox 1]+[lindex $sbbox 3])/2]
.pgaw:Schema.c create line $x1 $y1 [expr $x1-10] $y1 \
-tags [subst {links lkid$i}] -width 3
set x2 $dre set x2 $dre
set y2 [expr ([lindex $dbbox 1]+[lindex $dbbox 3])/2] set y2 [expr ([lindex $dbbox 1]+[lindex $dbbox 3])/2]
.pgaw:Schema.c create line $x2 $y2 [expr $x2+10] $y2 -width 3 \ .pgaw:Schema.c create line $x1 $y1 [expr $x1-10] $y1 \
-tags [subst {links lkid$i}] [expr $x1-10] $y1 [expr $x2+10] $y2 \
.pgaw:Schema.c create line [expr $x1-10] $y1 [expr $x2+10] $y2 \ $x2 $y2 [expr $x2+10] $y2 \
-tags [subst {links lkid$i}] -width 2 -tags [subst {links lkid$i}] -width 2
} }
incr i incr i
} }
...@@ -405,8 +415,8 @@ proc {linkClick} {x y} { ...@@ -405,8 +415,8 @@ proc {linkClick} {x y} {
global PgAcVar global PgAcVar
set obj [.pgaw:Schema.c find closest $x $y 1 links] set obj [.pgaw:Schema.c find closest $x $y 1 links]
if {[getTagInfo $obj link]!="s"} return if {[getTagInfo $obj link]!="s"} return
.pgaw:Schema.c itemconfigure [.pgaw:Schema.c find withtag hili] -fill black .pgaw:Schema.c itemconfigure hili -fill black
.pgaw:Schema.c dtag [.pgaw:Schema.c find withtag hili] hili .pgaw:Schema.c dtag hili
.pgaw:Schema.c addtag hili withtag $obj .pgaw:Schema.c addtag hili withtag $obj
.pgaw:Schema.c itemconfigure $obj -fill blue .pgaw:Schema.c itemconfigure $obj -fill blue
} }
...@@ -457,8 +467,8 @@ if {$w==".pgaw:Schema.c"} { ...@@ -457,8 +467,8 @@ if {$w==".pgaw:Schema.c"} {
set PgAcVar(schema,panobject) tables set PgAcVar(schema,panobject) tables
if {$canpan} { if {$canpan} {
if {[.pgaw:Schema.c find withtag hili]!=""} { if {[.pgaw:Schema.c find withtag hili]!=""} {
.pgaw:Schema.c itemconfigure [.pgaw:Schema.c find withtag hili] -fill black .pgaw:Schema.c itemconfigure hili -fill black
.pgaw:Schema.c dtag [.pgaw:Schema.c find withtag hili] hili .pgaw:Schema.c dtag hili
} }
.pgaw:Schema configure -cursor hand1 .pgaw:Schema configure -cursor hand1
...@@ -482,7 +492,7 @@ global PgAcVar ...@@ -482,7 +492,7 @@ global PgAcVar
toplevel $base -class Toplevel toplevel $base -class Toplevel
wm focusmodel $base passive wm focusmodel $base passive
wm geometry $base 759x530+10+13 wm geometry $base 759x530+10+13
wm maxsize $base 1280 1024 wm maxsize $base [winfo screenwidth .] [winfo screenheight .]
wm minsize $base 1 1 wm minsize $base 1 1
wm overrideredirect $base 0 wm overrideredirect $base 0
wm resizable $base 1 1 wm resizable $base 1 1
...@@ -558,9 +568,6 @@ Window destroy .pgaw:Schema} -padx 2 -pady 3 -text [intlmsg Close] ...@@ -558,9 +568,6 @@ Window destroy .pgaw:Schema} -padx 2 -pady 3 -text [intlmsg Close]
entry $base.f.esn \ entry $base.f.esn \
-background #fefefe -borderwidth 1 -textvariable PgAcVar(schema,name) -background #fefefe -borderwidth 1 -textvariable PgAcVar(schema,name)
label $base.f.lsn -text [intlmsg {Schema name}] label $base.f.lsn -text [intlmsg {Schema name}]
place $base.c -x 5 -y 30 -width 748 -height 500 -anchor nw -bordermode ignore
place $base.f \
-x 5 -y 5 -width 748 -height 25 -anchor nw -bordermode ignore
pack $base.f.l \ pack $base.f.l \
-in .pgaw:Schema.f -anchor center -expand 0 -fill none -side left -in .pgaw:Schema.f -anchor center -expand 0 -fill none -side left
pack $base.f.e \ pack $base.f.e \
...@@ -580,6 +587,8 @@ Window destroy .pgaw:Schema} -padx 2 -pady 3 -text [intlmsg Close] ...@@ -580,6 +587,8 @@ Window destroy .pgaw:Schema} -padx 2 -pady 3 -text [intlmsg Close]
pack $base.f.lsn \ pack $base.f.lsn \
-in .pgaw:Schema.f -anchor center -expand 0 -fill none -side right -in .pgaw:Schema.f -anchor center -expand 0 -fill none -side right
pack $base.f -side top -anchor ne -expand 0 -fill x
pack $base.c -side bottom -fill both -expand 1
} }
...@@ -1185,8 +1185,8 @@ if {$PgAcVar(nt,tablename)==""} then { ...@@ -1185,8 +1185,8 @@ if {$PgAcVar(nt,tablename)==""} then {
focus .pgaw:NewTable.etabn focus .pgaw:NewTable.etabn
return return
} }
if {[.pgaw:NewTable.lb size]==0} then { if {([.pgaw:NewTable.lb size]==0) && ($PgAcVar(nt,inherits)=="")} then {
showError [intlmsg "Your table has no fields!"] showError [intlmsg "Your table has no columns!"]
focus .pgaw:NewTable.e2 focus .pgaw:NewTable.e2
return return
} }
......
#! /bin/sh #!/bin/sh
PATH_TO_WISH='@WISH@' PATH_TO_WISH='@WISH@'
PGACCESS_HOME='@PGACCESSHOME@' PGACCESS_HOME='@PGACCESSHOME@'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment