#87772 - 2002-09-11 09:20 PM
KixForms 2.0.3 form resize issue
|
Bonji
Starting to like KiXtart
Registered: 2001-09-28
Posts: 169
Loc: Virginia
|
Shawn,
I'm working on another User Manager to incorporate in a larger set of tools for managing an entire Active Directory network. I have a button on the form that resizes it and adds some more options. However, I get a bleed effect of some sort. I looked through some other posts and it may be something you were going to fix in 2.0.4, however I wanted to make sure. Does it have to do with the refresh problem? I added the work in progress to my web site along with the necessary dependency files (TSUserConfig.dll - WTS Options & KixForms - GUI).
BTW, I wanted to check and make sure it is OK for me to have a KixForms download on my site. It's the .zip I got from Rod's site. Would it be better for me to link to the KixForms site for the download?
Thanks, Ben http://www.rgcweb.org:90
|
Top
|
|
|
|
#87774 - 2002-09-11 09:36 PM
Re: KixForms 2.0.3 form resize issue
|
Bonji
Starting to like KiXtart
Registered: 2001-09-28
Posts: 169
Loc: Virginia
|
Interesting. My form has the problem every time. I wonder if an added frame is the culprit. When I 'wipe' another program on top of mine it clears up. Also, I can switch between programs and that clears it up. I'll try it without the extra frame and see if that helps.
Thanks, Ben http://www.rgcweb.org:90
|
Top
|
|
|
|
#87777 - 2002-09-11 10:05 PM
Re: KixForms 2.0.3 form resize issue
|
Bonji
Starting to like KiXtart
Registered: 2001-09-28
Posts: 169
Loc: Virginia
|
Thanks Shawn.
Lonkero - Our company intranet site is on port 80 and one must have a userid/password to even hit the default page. Hence a bad place to put KiX stuff. So I made another Web Site on our IIS server and set it to port 90 and opened it up to anonymous access. We only have the one internal web server that is published on the internet.
Ben http://www.rgcweb.org:90
|
Top
|
|
|
|
#87779 - 2002-09-11 10:20 PM
Re: KixForms 2.0.3 form resize issue
|
Bonji
Starting to like KiXtart
Registered: 2001-09-28
Posts: 169
Loc: Virginia
|
When I have a chance, I'll take a look at it. I set it up in a hurry and that was the first method that popped into my head. I would have lots of uses for your method though.
Thanks, Ben http://www.rgcweb.org:90 (maybe http://www.rgcweb.org/kixtart one day)
|
Top
|
|
|
|
#87780 - 2002-09-11 10:25 PM
Re: KixForms 2.0.3 form resize issue
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
Yeah - here's a small script that repros the problem ... definitley a bad thing ... must fix ... need coffee ...
code:
Break On $Form = CreateObject("Kixtart.Form") $Form.FontSize = 10 $Frame = $Form.Frame("Frame") $Frame.Size = 200,200 $Frame.Center $Frame.Top = 50 $Label = $Frame.Label("Label") $Label.Left = 30 $Label.Top = 30 $Label.BackColor = 255,255,255 $Button = $Form.Button("Move") $Button.Center $Button.Top = $Frame.Bottom + 10 $Button.OnClick = "Button_Click()" Function Button_Click() $Label.Top = 100 EndFunction $Form.Center $Form.Show While $Form.Visible $=Execute($Form.DoEvents) Loop Exit 1
-Shawn
|
Top
|
|
|
|
#87783 - 2002-09-12 04:24 AM
Re: KixForms 2.0.3 form resize issue
|
Alex.H
Seasoned Scripter
Registered: 2001-04-10
Posts: 406
Loc: France
|
Shawn, seems you ran in the same problem i've got with the weird windows priority to refresh GUI (20 more way to do it, only one or two to get a correct result with the most obvious manner). Get a look to MoveResize function for form and control (the 2 are different), maybe you'll find some stuff.
_________________________
? getobject(Kixtart.org.Signature)
|
Top
|
|
|
|
#87784 - 2002-09-12 04:28 AM
Re: KixForms 2.0.3 form resize issue
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11624
Loc: CA
|
Almost 2 months since your last post Alex, Welcome back
|
Top
|
|
|
|
#87785 - 2002-09-12 02:15 PM
Re: KixForms 2.0.3 form resize issue
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
Update - first off - I fixed a problem with the REFRESH method for ALL objects. This will be a (better) work-around fix in 2.0.4.
Secondly - Alex - your right - it would seem that Windows has a dozen different ways to refresh a window - and a dozen different different parameters for each way. But the krux of the problem is with the FRAME object itself ... its very unusual as far as windows control go.
I originally designed the FRAME object to have a non-transparent background. That is to say, if you placed a FRAME object over a group of OPTIONSBUTTONS that were created on the FORM, the options buttons would be hidden behind the frame. In order to create option buttons inside the frame, you had to create them as children of the frame. By the way - this is the only way that multiple optionbutton groups can be created (groups of mutually exclusive optionbuttons that is to say).
But then I saw that folks were using the FRAME object as a framing tool ... to frame controls already created on the form. So I switched back to a transparent frame ... but the thing is that there is a refresh problem when moving children on the frame now (current problem).
VBA handles this problem easily by just having a FRAME object that is non-transparent. There is no option to make it transparent. Haven't checked VB yet.
C++ (straight windows) handles this problem in a curious fashion. Frames are transparent but you can't really create multually exclusive optionbuttons that are children of the FRAME and have it work as expected. FRAMES are simply stand-alone OBJECTS that simply frame a group of controls. Early on, I was going to take this approach and decided against it
For example, in Kixtart/Kixforms parlance, if you wanted to create two FRAMES - each with two mutually exclusive option buttons, you would code this:
code:
$Form = CreateObject("Kixtart.Form") $Frame1 = $Form.Frame $Option1 = $Form.RadioButton $Option1.TabGroup = 1 $Option2 = $Form.RadioButton $Frame2 = $Form.Frame $Option3 = $Form.RadioButton $Option3.TabGroup = 1 $Option4 = $Form.RadioButton
Bascially what this is saying is that $Option1 and $Option3 are the "beginnings" of a set of mutually exclusive RADIOBUTTONS. Some other highlevel (COM) languages use this strategy as well (i think ACCESS VBA uses it and I've seen some others).
The big benefit of this strategy is that you can create mutliple sets of mutually exclusive RADIOBUTTONS on a form, with having to frame them inside FRAMES ... so I think that the TABGROUP property would be good to have, even without this problem.
Anyways, if anyone has any thoughts, please advise ... im going to continue to work on this ... [ 12. September 2002, 14:20: Message edited by: Shawn ]
|
Top
|
|
|
|
#87786 - 2002-09-12 03:28 PM
Re: KixForms 2.0.3 form resize issue
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
Apart from that - just in terms of discussion about structuring a script that supports dynamic window sizing ... I would tend to recommend this approach:
Instead of creating and re-creating all the "extra" controls everytime the form gets resized - might want to pre-create them ahead of time, then selectively ENABLE and DISABLE as required. I also think this apporach is alot more friendly in terms of managing the life-times (scope) of the objects. It would probably be "faster" as well.
Heres an example (it works-around the REFRESH problem by creating the controls as children of the form). Give it a spin and let me know your thoughts. Only caveat would be is if you had OPTIONBUTTONS in the extra bit ... but the TABGROUP property - when implemented, would take care of that.
code:
Break On $Form = CreateObject("Kixtart.Form") $Form.FontSize = 10 $Form.Resizable = 1 $Form.Size = 300,200 $TextBox1 = $Form.TextBox $TextBox1.Text = "<name>" $TextBox1.Center $TextBox1.Top = 20 $TextBox2 = $Form.TextBox $TextBox2.Text = "<address>" $TextBox2.Center $TextBox2.Top = $TextBox1.Bottom + 20 $Button = $Form.Button $Button.Text = "Extra >>" $Button.Center $Button.Top = 125 $Button.OnClick = "Button_Click()" $Frame = $Form.Frame $Frame.Text = "Extra:" $Frame.Size = 270,130 $Frame.Center $Frame.Top = $Form.ClientHeight + 10 $TextBox3 = $Form.TextBox $TextBox3.Text = "Data" $TextBox3.Left = $Frame.Left + 40 $TextBox3.Top = $Frame.Top + 30 $TextBox3.Enabled = 0 $TextBox4 = $Form.TextBox $TextBox4.Text = "Data" $TextBox4.Left = $Frame.Left + 40 $TextBox4.Top = $TextBox3.Top + 50 $TextBox4.Enabled = 0 Function Button_Click() If $Form.ClientHeight = 173 $TextBox3.Enabled = 1 $TextBox4.Enabled = 1 $Form.ClientHeight = $Frame.Bottom + 20 $Button.Text = "<< Extra" Else $Form.ClientHeight = 173 $Button.Text = "Extra >>" $TextBox3.Enabled = 0 $TextBox4.Enabled = 0 EndIf EndFunction $TextBox1.SetFocus $Form.Center $Form.Show While $Form.Visible $=Execute($Form.DoEvents) Loop Exit 1
[ 12. September 2002, 15:31: Message edited by: Shawn ]
|
Top
|
|
|
|
#87788 - 2002-09-12 05:00 PM
Re: KixForms 2.0.3 form resize issue
|
krabourn
Hey THIS is FUN
Registered: 2000-12-11
Posts: 244
Loc: San Antonio, Texas, USA
|
I assume that means I SHOULD NOT create objects (TextBox,CommandButton) as children of a Frame.
code:
$FrameConnection = $Form.Frame("Workstation/IP/User ID", 10, 10, 255, 50) $TextBoxName = $FrameConnection.TextBox(,5,20,175,25) $TextBoxName.SetFocus $ButtonConnect = $FrameConnection.CommandButton("Connect",$TextBoxName.Right + 5,20,65,25) $ButtonConnect.OnClick = "ButtonConnect_Click()" $ButtonDisconnect = $FrameConnection.CommandButton("Disconnect",$TextBoxName.Right + 5,20,65,25) $ButtonDisconnect.OnClick = "ButtonDisconnect_Click()" $ButtonDisconnect.Hide
_________________________
Kelly
|
Top
|
|
|
|
#87790 - 2002-09-12 07:26 PM
Re: KixForms 2.0.3 form resize issue
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
Using the idea of more "persistent" child controls of the Frame ... here's a script that better demonstrates the problem ... when the "extra" button is pressed, the window drops down to expose the extra controls. However, there is a ">>" button that will dynamically move one of the extra TextBoxes over to the left, by 5 pixels each click ... this is where the problem appears ... if one move the text box, then clicks the extra key twice - the frame is back to normal ... and like I said, the fixed REFRESH will cover this automatically.
code:
Break On $CLIENTHEIGHT = 170 $Form = CreateObject("Kixtart.Form") $Form.FontSize = 10 $Form.BackColor = 0,0,255 $Form.Resizable = 1 $Form.ClientWidth = 300 $Form.ClientHeight = $CLIENTHEIGHT $Form.Caption = "Children of the Frame" $TextBox1 = $Form.TextBox $TextBox1.Text = "FormChild-1" $TextBox1.Center $TextBox1.Top = 20 $TextBox2 = $Form.TextBox $TextBox2.Text = "FormChild-2" $TextBox2.Center $TextBox2.Top = $TextBox1.Bottom + 20 $Button = $Form.Button $Button.Text = "Extra >>" $Button.Size = 120,25 $Button.Center $Button.Top = 125 $Button.OnClick = "Button_Click()" $Frame = $Form.Frame $Frame.Text = "Frame:" $Frame.Size = 270,155 $Frame.Center $Frame.Top = $Form.ClientHeight + 10 $TextBox3 = $Frame.TextBox $TextBox3.Text = "FrameChild-1" $TextBox3.Center $TextBox3.Top = 30 $TextBox3.Enabled = 0 $TextBox4 = $Form.TextBox $TextBox4.Text = "FormChild-3" $TextBox4.Center $TextBox4.Top = 250 $TextBox4.Enabled = 0 $Button2 = $Form.Button $Button2.Text = "FrameChild-1 >>" $Button2.Size = 120,25 $Button2.Center $Button2.Top = $Frame.Bottom + 10 $Button2.OnClick = "Button2_Click()" $Button3 = $Form.Button $Button3.Text = "FormChild-3 >>" $Button3.Size = 120,25 $Button3.Center $Button3.Top = $Button2.Bottom + 10 $Button3.OnClick = "Button3_Click()"
$Button4 = $Form.Button $Button4.Text = "Frame >>" $Button4.Size = 120,25 $Button4.Center $Button4.Top = $Button3.Bottom + 10 $Button4.OnClick = "Button4_Click()" Function Button_Click() If $Form.ClientHeight = $CLIENTHEIGHT $TextBox3.Enabled = 1 $TextBox4.Enabled = 1 $Button2.Enabled = 1 $Button.Text = "<< Extra" $Form.ClientHeight = $Button4.Bottom + 20 $Form.Center Else $Form.ClientHeight = $CLIENTHEIGHT $Form.Center $Button.Text = "Extra >>" $TextBox3.Enabled = 0 $TextBox4.Enabled = 0 $Button2.Enabled = 0 EndIf EndFunction Function Button2_Click() $TextBox3.Left = $TextBox3.Left + 5 EndFunction Function Button3_Click() $TextBox4.Left = $TextBox4.Left + 5 EndFunction Function Button4_Click() $Frame.Left = $Frame.Left + 5 EndFunction $TextBox1.SetFocus $Form.Center $Form.Show While $Form.Visible $=Execute($Form.DoEvents) Loop Exit 1
-Shawn [ 12. September 2002, 23:21: Message edited by: Shawn ]
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 255 anonymous users online.
|
|
|