Hi
I need help for a problem.
How to prohibit the change in TabControl if a condition be not accepted.
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
... and you could use HideTab if the conditions are not accepted and use ShowTab if they are accepted.
Fred
Hello Fred
I didn't get to do your suggestion to work.
Please see the video that I posted.
Regards
Velasquez
Hello Fred
I posted a video of my TabControl.
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
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.
Hi Fred
I posted my file.odcl for you to see.
Regards,
Velasquez
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?
Yes I used PhotoShop and SnagIt 8 Editor, to create all the images.
Does nobody know a form please of working around of my problem with TabControl?
Tanks
Hi velasquez, tomorrow I'm in the office so I can have a try.
Fred
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
Hi velasquez,
the textbox "AlturaTextoDados" uses FilterStyle Text. Why don't you use DecimalUnits?
Fred
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?
Hi, velasquez,
DecimalUnits do not accepts ",". I just had a test.
QuoteDo 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
Hi Fred
Did I look and didn't I find DecimalUnits in the filter styles?
How to determine this?
Sorry, in my German release it is called "Dezimalzahlen". In your English release it is NumericUnits.
Fred
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])
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
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
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
Quote from: velasquez on September 30, 2008, 02:29:05 PM
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.
Thank you Owen,
Great your work.
Velasquez