[GiDlist] Problems with combobox

Moderator: GiD Team

Post Reply
ascosta at portugalmail.pt

[GiDlist] Problems with combobox

Post by ascosta at portugalmail.pt »

An embedded and charset-unspecified text was scrubbed...
Name: not available
Url: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20051109/605400a5/attachment.txt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20051109/605400a5/attachment.htm
Martin Meiler

[GiDlist] GiD Toolbar

Post by Martin Meiler »

Hello everybody,


i want to create my own problemtype specific toolbar as well as change
some commands for the standard toolbars.

Right now i found out, that there are some function within the scripts
directory (tclfileP.tcl and GrDataMenus.tcl) where the toolbars are defined.

Are there any easier functions to edit/create toolbars.

Thanks in advance

Regards

Martin




--
--------------------------------------------------------------------

_/ _/_/ _/_/_/ Friedrich Alexander Universität Erlangen
_/ _/ _/ _/ Lehrstuhl für Sensorik
_/ _/ _/ Paul-Gordanstr. 5, 91052 Erlangen, Germany
_/ _/_/ _/_/
_/ _/ _/ University of Erlangen
_/ _/ _/ _/ Department of Sensor Technology
_/_/_/ _/_/ _/_/_/ Paul-Gordanstr. 5, 91052 Erlangen, Germany


Dipl.-Ing. Martin Meiler

tel.: (+49)-9131-85-23140
fax.: (+49)-9131-85-23133

email: Martin.Meiler at lse.eei.uni-erlangen.de
User avatar
escolano
Posts: 1961
Joined: Sun Sep 05, 1982 10:51 pm

[GiDlist] Problems with combobox

Post by escolano »

I don't know what's the problem
When you press draw for example, all condion window widgets are temporary set to disable callint the GiD procedure
RecursiveChangeState $w disable
But when press finish, they are restored to the previous state with
RecursiveChangeState $w restore

In other hand: some advices:
- "combobox" is an obselete, pure tcl, megawidget. You can use instead the "ComboBox" widget of BWidget (note the Upper C and B letters). Off course the use syntax and properties are differents.
- You NEVER must directly modify any tcl file located inside /scripts of GiD !!
else you need to modify this scripts each time that you update to a new GiD version.
You must add your own tcl code in your problemtype scripts.
- In order to modify the body of the GiD standard Conditions window, don't directly remove and add widgets,
must use TKWIDGET (read GiD help about TCL-TK Extension - Custom data windows)

Regards

Enrique Escolao

----- Original Message -----
From: ascosta at portugalmail.pt
To: gidlist at gatxan.cimne.upc.es
Sent: Wednesday, November 09, 2005 1:58 PM
Subject: [GiDlist] Problems with combobox


Hello everybody,

I use a combobox in my tcl file, called in conditions file.
But after i Assign this condition to points (or Draw), the combobox becames disable.
The combobox to becames enable i have to close the window and open it again.

I define the combobox by this way:

set ProblemTypePriv(pointcombo) [combobox $wdataw.f1b.c -editable 1
-keephistory 0 -history $lcns -textvar ProblemTypePriv(pointcombotext)
]
$wdataw.f1b.c del 0 end
$wdataw.f1b.c ins end $cname
$wdataw.f1b.c conf -editable 0
set GidData(CND,combo) $wdataw.f1b.c
GidHelp $wdataw.f1b.c "This is a list of all created point loads. In this menu it is "
"selected the active point load."
trace var ProblemTypePriv(pointcombotext) w "ChangeToPointCombo ;#"

What is the problem??


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20051109/b94263e2/attachment.htm
User avatar
escolano
Posts: 1961
Joined: Sun Sep 05, 1982 10:51 pm

[GiDlist] GiD Toolbar

Post by escolano »

Hello,

1) As I remarked in my previous GiDList message: must NEVER modify the GiD
tcl scripts !!
2) I also recommend to not modify the standar toolbars (changing variables
used in GrDataMenus, etc), else probably your problemtype will not work for
the proper next version, because we don't know your changes. If we simply
rename a variable your code will be broken.
3) You can see a simple example of Tcl/Tk customization at
http://www.gidhome.com/2004/material_courses.subst
Read chapter 08-Tool of mesh edition (it creates a new toolbar)
4) Each user can modify, without programming, the standart macros toolbar,
adding customized icons to invoke their own commands

Regards

Enrique Escolano

----- Original Message -----
From: "Martin Meiler" Martin.Meiler at lse.eei.uni-erlangen.de
To: gidlist at gatxan.cimne.upc.es
Sent: Wednesday, November 09, 2005 3:09 PM
Subject: [GiDlist] GiD Toolbar


Hello everybody,


i want to create my own problemtype specific toolbar as well as change
some commands for the standard toolbars.

Right now i found out, that there are some function within the scripts
directory (tclfileP.tcl and GrDataMenus.tcl) where the toolbars are
defined.

Are there any easier functions to edit/create toolbars.

Thanks in advance

Regards

Martin




--
--------------------------------------------------------------------

_/ _/_/ _/_/_/ Friedrich Alexander Universität Erlangen
_/ _/ _/ _/ Lehrstuhl für Sensorik
_/ _/ _/ Paul-Gordanstr. 5, 91052 Erlangen, Germany
_/ _/_/ _/_/
_/ _/ _/ University of Erlangen
_/ _/ _/ _/ Department of Sensor Technology
_/_/_/ _/_/ _/_/_/ Paul-Gordanstr. 5, 91052 Erlangen, Germany


Dipl.-Ing. Martin Meiler

tel.: (+49)-9131-85-23140
fax.: (+49)-9131-85-23133

email: Martin.Meiler at lse.eei.uni-erlangen.de

_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist

User avatar
miguel
Posts: 361
Joined: Thu Sep 25, 2014 9:04 am

[GiDlist] GiD Toolbar

Post by miguel »

You can use the 'Utilities-Tools-Macros...' to create your own macros with
icons associated which will be put on the 'macros icon toolbar', or, if you
want to add a new toolbar, follow this little example:


proc MyWarnWin { msg } {
tk_messageBox -message "$msg" -icon warning -type ok
}

proc MyNewBarShowHelp { } {
MyWarnWin "help [ lindex [.central.s info Project] 4]"
}

proc MyNewBarProc { { what DEFAULT} { img_dir ""}} {
global MyNewBarBitmapsNames MyNewBarBitmapsCommands MyNewBarBitmapsHelp
global MyNewBarImgDir

set MyNewBarBitmapsNames(0) "new.gif open2.gif save.gif --- help.gif"

set MyNewBarBitmapsCommands(0) [ list {-np- MyWarnWin new} \
{-np- MyWarnWin read} \
{-np- MyWarnWin save} "" \
{-np- MyNewBarShowHelp}
]
set MyNewBarBitmapsHelp(0) [ list "New" "Open" "Save" "" "Help status"]

CreateOtherBitmaps MyNewBar "My new Bar" MyNewBarBitmapsNames \
MyNewBarBitmapsCommands MyNewBarBitmapsHelp \
"$::MyNewBarImgDir" MyNewBarBitmaps $what PrePost

AddNewToolbar "My new bar" PrePostMyNewBarWindowGeom \
MyNewBarProc "My new bar title"

}


Then, at you problem_type.tcl just call MyNewBarProc to display your bar.

The first time it'll appear as a standalone window, but if you right-click
above it and select 'configure toolbars' you can change the place of you
icon bar. With this example, the name 'My new bar' will appear in the
listbox.

miguel


-----Mensaje original-----
De: gidlist-admin at gatxan.cimne.upc.edu
[mailto:gidlist-admin at gatxan.cimne.upc.edu] En nombre de Enrique Escolano
Enviado el: miércoles, 09 de noviembre de 2005 16:27
Para: gidlist at gatxan.cimne.upc.edu
Asunto: Re: [GiDlist] GiD Toolbar

Hello,

1) As I remarked in my previous GiDList message: must NEVER modify the GiD
tcl scripts !!
2) I also recommend to not modify the standar toolbars (changing variables
used in GrDataMenus, etc), else probably your problemtype will not work for
the proper next version, because we don't know your changes. If we simply
rename a variable your code will be broken.
3) You can see a simple example of Tcl/Tk customization at
http://www.gidhome.com/2004/material_courses.subst
Read chapter 08-Tool of mesh edition (it creates a new toolbar)
4) Each user can modify, without programming, the standart macros toolbar,
adding customized icons to invoke their own commands

Regards

Enrique Escolano

----- Original Message -----
From: "Martin Meiler" Martin.Meiler at lse.eei.uni-erlangen.de
To: gidlist at gatxan.cimne.upc.es
Sent: Wednesday, November 09, 2005 3:09 PM
Subject: [GiDlist] GiD Toolbar


Hello everybody,


i want to create my own problemtype specific toolbar as well as change
some commands for the standard toolbars.

Right now i found out, that there are some function within the scripts
directory (tclfileP.tcl and GrDataMenus.tcl) where the toolbars are
defined.

Are there any easier functions to edit/create toolbars.

Thanks in advance

Regards

Martin




--
--------------------------------------------------------------------

_/ _/_/ _/_/_/ Friedrich Alexander Universität Erlangen
_/ _/ _/ _/ Lehrstuhl für Sensorik
_/ _/ _/ Paul-Gordanstr. 5, 91052 Erlangen, Germany
_/ _/_/ _/_/
_/ _/ _/ University of Erlangen
_/ _/ _/ _/ Department of Sensor Technology
_/_/_/ _/_/ _/_/_/ Paul-Gordanstr. 5, 91052 Erlangen, Germany


Dipl.-Ing. Martin Meiler

tel.: (+49)-9131-85-23140
fax.: (+49)-9131-85-23133

email: Martin.Meiler at lse.eei.uni-erlangen.de

_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist


_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist
Post Reply