PDA

View Full Version : sd-create-display-table


ceuro
12-22-2004, 08:24 AM
How can I know on which row and cell the focus is set when the doubleClickAction is called ?
If I call a dialog with the sd-call-dialog funciton from the the doubleClickAction
and the dialog populates the table how can I refresh the content of the starting
table ?
I have also problems managing the calls at the functions.
With this code
"
(sd-hide-display-table "table")
(sd-call-dialog (format nil "PART :parte ~s" part))
(sd-show-display-table (format nil "table")) "
The table is diplayed immediatly, I wnat first to see the dialog and
theh the table.
How can I do ?
Thx

Thom Ivancso
12-22-2004, 09:19 AM
Hello ceuro,


Well you can call a display table from within a dialog menu by adding in the following statements in the variable that you want to call the table from and when you pick the cell in the table it will populate the data into thew dialog variable.

The two lines that are needed are as such.


:show-input-tool (sd-show-display-table "display table name" :position '("TOP-MENU-TOOLBOX-TB" :lefttop 70 50))
:hide-input-tool (sd-hide-display-table "display table name" :ignorePin t)


So the code in the dialog box would look like this.


(sd-defdialog 'Dialog Menu name
:dialog-title "Some Title"
;;:dialog-control :parallel
:toolbox-button nil
:variables
'(
(Make this the same name of cell in display table
:value-type :string
:title "Title"
:show-input-tool (sd-show-display-table "display table name" :position '("TOP-MENU-TOOLBOX-TB" :lefttop 70 50))
:hide-input-tool (sd-hide-display-table "display table name" :ignorePin t)
:prompt-text "Select Cell from Display Table"
)
)
)


Just remeber to make the variable name the same as that of the cell name in the display table.

HTH
Cheers
Thom

ceuro
12-23-2004, 12:11 AM
This is not what I'm looking for.
I have to call a dialog from the table (not the table from the dialog),
this dialog will update my data (not only one cell), then I have to go back
to the table that have to show the new data (something like a refresh).
And how can I know in which line and cell the focus is set in the table ?
There are any variables that can tell me that ?
Thx again

Thom Ivancso
12-23-2004, 07:25 AM
Hello ceuro,

I looked at your question backwards my applogizes, could it be possible for you to post the entire lisp routine here. It may help me understand a little better what it is your looking for it to do.

Cheers
Thom

ceuro
12-23-2004, 07:54 AM
The sequence should be:
dialog lc-dialog-all-info-prt
(with show-input-tool the table is called)
table vt_info_part_sd
(with double click a new dialog depending on which cell I'm working on)
dialog LC_OMS_ATTRIBUTI or LC_OMS_ATTRIBUTI_DIS
(again on the table with the new data in the logical table)
table vt_info_part_sd

Thx again


(defun controlla-attributi (table)
; here I should know which cell has been clicked
; to decide which dialog to call

(sd-hide-display-table "vt_info_part_sd")
; if I'm on cell this
(sd-call-dialog (format nil "LC_OMS_ATTRIBUTI :parte ~s" parte-gruppo-sd))
; else , I'm on another cell
(sd-call-dialog (format nil "LC_OMS_ATTRIBUTI_DIS :parte ~s" parte-gruppo-sd))
;after the dialog the table should have a refresh with its new data
(sd-show-display-table (format nil "vt_info_part_sd"))
)

; this is the first dialog from which the table is called
(sd-defdialog 'lc-dialog-all-info-prt
:dialog-title "Tabella Info"
:variables '
(
(TABLE-INFO
:initial-value
(let
( (tree (lc-f-inq-obj-tree-list (sd-pathname-to-obj "/") ) ) )

(sd-remove-logical-table-row "lt_info_part" :row :all)

;(dolist (var list value) exp) -Valuta l'espressione (exp) una volta per ogni menbro della lista
(dolist
(
;var
i
;list
tree
;value after the last iteration
)
;expression
(sd-insert-logical-table-row
"lt_info_part"
:contents
(
list (sd-inq-obj-pathname i)
(lc-txt-prt-fam-get (sd-inq-obj-pathname i))
(lc-txt-prt-cod-get (sd-inq-obj-pathname i))
(lc-txt-prt-rev-get (sd-inq-obj-pathname i))
;TEST(lc-txt-prt-oid-get (sd-inq-obj-pathname i))
" | "
(lc-txt-drw-fam-get (sd-inq-obj-pathname i))
(lc-txt-drw-cod-get (sd-inq-obj-pathname i))
(lc-txt-drw-rev-get (sd-inq-obj-pathname i))
;TEST(lc-txt-drw-oid-get (sd-inq-obj-pathname i))
)
)
)
)
)


(PART-SEL
:title "Parte-Gruppo"
:value-type :string
;here the table is called
:show-input-tool (sd-show-display-table "vt_info_part" :position '("INFO-PARTE" :leftCenter 0 0))

)

)
:without-show t
:start-variable 'part-sel
;:ok-action '(lc-callback-save-leged (sd-pathname-to-obj part-sel) (sd-pathname-to-obj part-sel) 0)
)
;; Logical Table

; this is the logical table

(sd-create-logical-table "lt_info_part"
;TEST:columns '(:part_name :p_fam :p_code :p_rev :p_oid :sep :d_fam :d_code :d_rev :d_oid)
:columns '(:part_name :p_fam :p_code :p_rev :sep :d_fam :d_code :d_rev)
:keyColumns '(:part_name)
:columnNames *GED_g_lsTableColName*
;TEST:types '(:string :string :string :string :string :string :string :string :string :string)
:types '(:string :string :string :string :string :string :string :string)
)


;this is the dispaly of the logical table
(sd-create-display-table "vt_info_part_sd"
:tableTitle "Info Parti e Disegni"
:logicalTable "lt_info_part"
;TEST:columns '(:part_name :p_fam :p_code :p_rev :p_oid :sep :d_fam :d_code :d_rev :d_oid)
:columns '(:part_name :p_fam :p_code :p_rev :sep :d_fam :d_code :d_rev)
:applyColumns '(:part_name)
:displayWidth 700
:displayHeight 300
:applyAction '(test-and-save-sd-all parte-gruppo-sd)
:keyColumnsApplyToken :keyValues
:selectionMode :single-cell
;with double click I want to star a new dialog depending on the cell I'm working on
:doubleClickAction 'controlla-attributi
)

; first dialog called from the table
(sd-defdialog 'LC_OMS_ATTRIBUTI
:dialog-title "Parti"
:start-variable 'parte
:after-initialization
'(progn

(setq p_parte (sd-inq-obj-pathname parte))
(setq Famiglia (lc-get-attr-prt p_parte "fam"))

(azzera_var)
(carica_var)
)
:variables
'(
(parte
:value-type :part-assembly
:show-input-tool (oli:sd-show-graphical-browser "parcel-gbrowser")
:modifies :contents
:title "Parte/Gruppo"
:prompt-text "Seleziona la parte o il gruppo."
:after-input
(progn

(setq p_parte (sd-inq-obj-pathname parte))
(setq Famiglia (lc-get-attr-prt p_parte "fam"))


(azzera_var)
(carica_var)

)
)
more code here ...

; second dialog called from the table
(sd-defdialog 'LC_OMS_ATTRIBUTI_DIS
:dialog-title "Disegni"
:start-variable 'disegno
:after-initialization
'(progn

(setq p_disegno (sd-inq-obj-pathname disegno))
(setq Famiglia (lc-get-attr-drw p_disegno "fam"))

(azzera_var)
(carica_var)
)
:variables
'(
(disegno
:value-type :part-assembly
:show-input-tool (oli:sd-show-graphical-browser "parcel-gbrowser")
:modifies :contents
:title "Disegno"
:prompt-text "Seleziona il disegno."
:after-input
(progn

(setq p_disegno (sd-inq-obj-pathname disegno))
(setq Famiglia (lc-get-attr-drw p_disegno "fam"))

(azzera_var)
(carica_var)
)
)
(Famiglia
:value-type :string
:show-input-tool (oli:sd-show-graphical-browser *dirbrowser-dis*)
:after-input
(progn
;********azzera la visualizzazione degli attributi********************


(azzera_var)
(carica_var)

)
)
more code here