Boards /
Runtime/AutoLISP /
Topic 440
Condition for TabControl
Started by velasquez ·
2008-09-30 21:29 UTC ·
23 replies · SMF topic #440
velasquez
2008-09-30 21:29 UTC
Hi
I need help for a problem.
How to prohibit the change in TabControl if a condition be not accepted.
fred_tomke
2008-10-01 07:07 UTC
Hello,
1. there are two events for tabs: OnChanged OnSelChanging. If the user changes the tab although the conditions are not accepted you could changed the selected tab back (with a message what the user has to to.
2. when OnSelChanging events will be fired you should disable all controls in the selected tab.
Regards
Fred
fred_tomke
2008-10-01 07:08 UTC
... and you could use HideTab if the conditions are not accepted and use ShowTab if they are accepted.
Fred
velasquez
2008-10-01 12:19 UTC
Hello Fred
I didn't get to do your suggestion to work.
Please see the video that I posted.
Regards
Velasquez
velasquez
2008-10-01 12:34 UTC
Hello Fred
I posted a video of my TabControl.
fred_tomke
2008-10-01 20:21 UTC
yeeeees, and after the error message you should activate the configuration tab again (I believe SetCurSel).
BTW: how did you create the white-blue gradient in the left tab? Are these all images?
Fred
velasquez
2008-10-01 20:44 UTC
Hi Fred
I used dcl_Tab_SetCurSel, but nothing impedes the change of TabControl.
I believe that this is not possible. But it is a lot of imprtante.
Do you have some other idea?
See the image that I used in the bottom of TabControl.
velasquez
2008-10-01 20:56 UTC
Hi Fred
I posted my file.odcl for you to see.
Regards,
Velasquez
bazzacad
2008-10-02 01:42 UTC
Great use of the PictureBox Velasquez, really good looking stuff.
Do you use PhotoShop to create the raised (Mouse Over) buttons, or is there an easier way?
velasquez
2008-10-02 11:34 UTC
Yes I used PhotoShop and SnagIt 8 Editor, to create all the images.
velasquez
2008-10-03 17:59 UTC
Does nobody know a form please of working around of my problem with TabControl?
Tanks
fred_tomke
2008-10-05 18:27 UTC
Hi velasquez, tomorrow I'm in the office so I can have a try.
Fred
fred_tomke
2008-10-06 06:43 UTC
Hi, velasquez,
I send you an example. If the checkbox is not checked you cannot change the tabs.
Sorry for the delay. I was out of office in the last week cause of a trade fair for surveyors, cities and governments. At these times I can only send short answers. Especially not at the days. In the next weeks I will be out very often for roadshows, customer trainings and so on.
Hope this helps.
Fred
fred_tomke
2008-10-06 11:26 UTC
Hi velasquez,
the textbox "AlturaTextoDados" uses FilterStyle Text. Why don't you use DecimalUnits?
Fred
velasquez
2008-10-06 13:15 UTC
Hi Fred
I didn't use DecimalUnits because he accepts "," and the height of the text not accepts.
With FilterStyle Text it is easier to control this.
I use the function below:
(dcl_TextBox_SetFilter DuctilCAD_DuctilCAD_MainForm_AlturaTextoDados " .0123456789 ")
Do you know me to say because OnClicked is not added the c:tab_tabtest_chb_acceptcondition of your TabTest?
fred_tomke
2008-10-06 14:41 UTC
Hi, velasquez,
DecimalUnits do not accepts ",". I just had a test.
Do you know me to say because OnClicked is not added the c:tab_tabtest_chb_acceptcondition of your TabTest?
I have removed it manually ;) .
Fred
velasquez
2008-10-06 16:52 UTC
Hi Fred
Did I look and didn't I find DecimalUnits in the filter styles?
How to determine this?
fred_tomke
2008-10-06 18:19 UTC
Sorry, in my German release it is called "Dezimalzahlen". In your English release it is NumericUnits.
Fred
velasquez
2008-10-06 19:22 UTC
Hi Fred
NumericUinits accepts many characters that are not for me.
See "----/ / / /....------++++-----"
The work to manipulate is very big.
I prefer to filter the entrance in ".0123456789 "
I used your function for TabControl with Opendcl 4.1.2.2, she worked perfectly.
Thank you very much for your help.
I posted the methods below in " Feature Request ".
(dcl_Tab_DisableTab Project1_Form1_TabControl1 nIndex [as Integer])
(dcl_Tab_EnableTab Project1_Form1_TabControl1 nIndex [as Integer])
fred_tomke
2008-10-06 21:11 UTC
Hi velasquez, hm, unfortunately, you are right, that all mathematic characters are allowed in numeric styled textboxes. I think about our many customers and the very often textboxes in NumericUnits style. Until now never a customer had a problem with it.
However, numeric styled textboxes suppress the text-characters. For the rest I do the following:
(defun c:blocks_sc_block_size_edt_x (/ strText uVal)
(if (and (setq strText (dcl_Control_getText blocks_sc_block_size_edt_x))
(setq uVal (read_secure strText))
(numberp uVal)
(> uVal 0.0))
(progn
(setq reaX uVal)
); progn
(dcl_Control_setText blocks_sc_block_size_edt_x (rtos reaX 2 4))
); if
); c:blocks_sc_block_size_edt_x
(defun read_secure (uValue)
(if (not (and (= (type uValue) 'STR)
(setq uValue (if (= (substr uValue 1 1) ".") (strcat "0" uValue) uValue))
(setq uValue (if (= (substr uValue 1 2) "-.") (strcat "-0" (substr uValue 2)) uValue))
(setq uValue (vl-catch-all-apply 'read (list uValue)))
(not (vl-catch-all-error-p uValue))))
(setq uValue nil)
); if
uValue
); read_secure
This function c:blocks_sc_block_size_edt_x will be called when OnKillFocus or OnReturnPressed will be fired.
But you have another chance: Activate the OnEditChanged event and check if the value is correct or not. If not, reset the text to the value before. I know it's not understandable what I mean. I can give you an example tomorrow. I'm tired now.
Fred
fred_tomke
2008-10-15 14:18 UTC
Hello velasquez, I have just read that you wanted to post feature requests for dcl_Tab_DisableTab and dcl_Tab_EnableTab. Just if you didn't know: there are already two methods HideTab and ShowTab. Maybe they can help you. I use these methods.
Fred
velasquez
2008-10-15 17:11 UTC
Hello Fred,
I tested the methods for and to Hide and to Show Tab.
But I still believe that to incapacitate it would be the best solution.
It is easier to show when a problem exists.
Thanks
owenwengerd
2008-10-18 16:38 UTC
author=velasquez link=topic=440.msg1969#msg1969 date=1222810145 wrote:
How to prohibit the change in TabControl if a condition be not accepted.
In OpenDCL 5 Beta 1 the OnChanging event can be used to prevent the change. The event handler can return T to prevent the change, or anything else to allow it.
velasquez
2008-10-18 17:48 UTC
Thank you Owen,
Great your work.
Velasquez