Tab strip problem

Started by Iulian, January 06, 2010, 04:08:31 AM

Previous topic - Next topic

Iulian

Hello again! I have a new small problem..if can somebody help me...

I have a modal form, which contains a tab strip with 3 tabs.
On the second tab I have a graphic button, which if is clicked, the modal form closes for getting a point, and then the modal form appears.
When the form appears, the tab strip is with his first tab selected, and I want it to be with the second tab, the tab from which has started this action.

What should I do?
Thanks.

Kerry


(dcl_TabStrip_SetCurSel Project_Form_TabStrip1 <TabIndex [as Long]>)


What you'll need to do is set a global variable before you close the form.
Then, in your initialisation event handler test for the variable ;
if it exists set it to nil and call the SetCurSel Method to display the second page.


Perfection is not optional.
My other home is TheSwamp

Iulian

Sorry, but I could not resolve my problem...I don`t know where I should write the text, and how I should test the variable. I tried to use (dcl_TabStrip_GetCurSel proj_Form_TabStrip1) and set this value into a variable, for using it with (dcl_TabStrip_SetCurSel proj_Form_TabStrip1 TabIndex [as Long]), but I receive errors....I don`t know how I should write this...
I attached a small example with my problem, if can somebody help me...
Thanks.

Fred Tomke

Iulian,

for nested forms I ask you to study this topic, espeacially the samples.

In the event for selecting points you ask for the last tab.
Code (autolisp) Select
(defun c:project_Form2_TextButton1_OnClicked (/)
  (setq intLastTab (dcl_TabStrip_GetCurSel project_Form2_TabStrip1))
  (dcl_Form_Close project_Form2 5)
)


In the initialisation of Form2 you set the current tab (you'll have to activate the event).
Code (autolisp) Select

(defun c:project_Form2_OnInitialize (/)
  (if intLastTab (dcl_TabStrip_SetCurSel project_Form2_TabStrip1 intLastTab))
)


Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

Kerry

Try this

Code (autolisp) Select

;; TestTabReturn.lsp TestTabReturn.odcl

(defun c:DOIT (/) (c:TestTabReturn) (princ))

;;;---------------------------------------------------------------------------
;;;
(defun c:TestTabReturn (/)
  ;; Codehimbelonga kdub@opendcl.com
  (vl-load-com)
  (command "._OPENDCL")
  (dcl_project_load "TestTabReturn" t)
  (setq ODCLReturn (dcl_form_show TestTabReturn_Form))
  ;;
  (cond ((= ODCLReturn 110)
         (setq *ReturnToPageTwo T)
         (_SelectOnScreen)
         (setq ODCLReturn (dcl_form_show TestTabReturn_Form))
        )
  )
  (princ)
)
(princ "\n TestTabReturn or DOIT to run.")
(princ)

;;;---------------------------------------------------------------------------
;;;
(defun _SelectOnScreen ()
  (setq *var (getpoint))
  (setq ODCLReturn (dcl_form_show TestTabReturn_Form))
)
;;;---------------------------------------------------------------------------
;;;
(defun c:TestTabReturn_Form_OnInitialize (/)
  (if (and *ReturnToPageTwo *var)
    (progn (dcl_TabStrip_SetCurSel TestTabReturn_Form_TabStrip1 1)
           (dcl_Control_SetText TestTabReturn_Form_TextBox1 (vl-princ-to-string *var))
    )
  )
  (setq *ReturnToPageTwo nil
        *var nil
  )
)
;;;---------------------------------------------------------------------------
;;;
(defun c:TestTabReturn_Form_TextButton1_OnClicked (/)
  (dcl_Form_Close TestTabReturn_Form 110)
)


;;;---------------------------------------------------------------------------
;;;
(princ)
Perfection is not optional.
My other home is TheSwamp

Kerry



Ooops, didn't see your posted sample.
Perfection is not optional.
My other home is TheSwamp

Iulian

Thanks a lot guys...with these codes I resolved my problem..I know that was a stupid problem...and I`m sorry for that, but I don`t understand all the samples...because I have some difficulties with AutoLISP... for this reason I put some stupid questions sometimes...
Thanks again.