Tab strip problem

Started by Iulian · 2010-01-06 12:08 UTC · 6 replies · SMF topic #1111

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.
Attachments

(dcl_TabStrip_SetCurSel Project_Form_TabStrip1 )


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.


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.
Attachments
Iulian,

for nested forms I ask you to study {2}, espeacially the samples.

In the event for selecting points you ask for the last tab.
(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).

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


Fred
Try this


;; 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)
Attachments


Ooops, didn't see your posted sample.
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.