Page 1 of 2 12>
Topic Options
#87772 - 2002-09-11 09:20 PM KixForms 2.0.3 form resize issue
Bonji Offline
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
#87773 - 2002-09-11 09:23 PM Re: KixForms 2.0.3 form resize issue
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ben, shawn hasn't complained about me having his whatever version of the dll on my site...

what comes to resize of form, my bbchecker uses it with no problems.
I've seen with 2.0.3 that the form does not draw correctly (today) but 99,99% of runs are working just fine.
_________________________
!

download KiXnet

Top
#87774 - 2002-09-11 09:36 PM Re: KixForms 2.0.3 form resize issue
Bonji Offline
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
#87775 - 2002-09-11 09:40 PM Re: KixForms 2.0.3 form resize issue
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Of course you can put Kixforms on your site ... no need to even ask ...

Yeah - can see the problem straight away - hears a quick work-around until I get home and look closer at it:

$USR_FORM.Refresh
$USR_FORM.BackColor = $USR_FORM.BackColor

Thing is ... you did set things up proper ... that is ... created your frame contols as children of the frame ... so will definitely look into it asap ...

[ 11. September 2002, 21:41: Message edited by: Shawn ]

Top
#87776 - 2002-09-11 09:50 PM Re: KixForms 2.0.3 form resize issue
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ben, first time I see someone using portnumber on public webpage...
how's that?
_________________________
!

download KiXnet

Top
#87777 - 2002-09-11 10:05 PM Re: KixForms 2.0.3 form resize issue
Bonji Offline
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
#87778 - 2002-09-11 10:15 PM Re: KixForms 2.0.3 form resize issue
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
havent played with iis so much... only our intranet is on iis...

but what is my experience with apache, a page named:
kixtart.www.rgcweb.org
or
www.rgcweb.org/kixtart

is not hard to redirect...
as virtual server or via redirect.

and what comes to easiness, form redirect is the sweetist.
have your storage where ever and the named server somewhere else. just put it load the site in 100% form and users see the original site address only. nice when you don't want to play with configuration files...
_________________________
!

download KiXnet

Top
#87779 - 2002-09-11 10:20 PM Re: KixForms 2.0.3 form resize issue
Bonji Offline
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 Offline
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
#87781 - 2002-09-11 10:41 PM Re: KixForms 2.0.3 form resize issue
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
shawn, correct me if I'm wrong, but the problem seems not to be (what I see looking your script) resizing the form but moving or resizing objects in it.
?
_________________________
!

download KiXnet

Top
#87782 - 2002-09-11 11:00 PM Re: KixForms 2.0.3 form resize issue
krabourn Offline
Hey THIS is FUN
*****

Registered: 2000-12-11
Posts: 244
Loc: San Antonio, Texas, USA
I know I have run into this. I am trying to change one of my big script into a gui solution and I use frames heavily.

If you change/patch the function to following, it will work.

code:
Function Button_Click()

$Label.Top = 100
$Frame.Hide
$Frame.Show

EndFunction

_________________________
Kelly

Top
#87783 - 2002-09-12 04:24 AM Re: KixForms 2.0.3 form resize issue
Alex.H Offline
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 Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
Almost 2 months since your last post Alex, Welcome back [Smile]
Top
#87785 - 2002-09-12 02:15 PM Re: KixForms 2.0.3 form resize issue
Shawn Administrator Offline
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 Offline
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
#87787 - 2002-09-12 04:15 PM Re: KixForms 2.0.3 form resize issue
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Rambling continued ... another option would be to split the frame functionality into two seperate objects ... the FRAME object and the GROUPBOX object ... very .NET like in some respects (the .NET FRAME is called GROUPBOX) ...

The FRAME object would be used for visual effect only - it would be transparent and serve as a que that the controls contained (bad word) within its borders are related in some way ... but other in that, would NOT support the ability to host child objects. If you moved the FRAME, the other controls would not move with it. Mutually exclusive RADIOBUTTONS would need the TABGROUP property set in order to enable exclusivity (?!)

The GROUPBOX object would look similar to the FRAME object, but would have full support for control containment - controls can be created inside the GROUPBOX, and if the GROUPBOX moved - the controls would go with it. The GROUPBOX would be NON-TRANSPARENT - at least until I get it to support all possible scenarios - at which time we can make the FRAME object obsolete - which is what .NET has done.

Top
#87788 - 2002-09-12 05:00 PM Re: KixForms 2.0.3 form resize issue
krabourn Offline
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
#87789 - 2002-09-12 06:36 PM Re: KixForms 2.0.3 form resize issue
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Well - im just green-lighting here but personally, I think your right on - we SHOULD be creating objects as the CHILDREN of SOMETHING. Whether that something should be a FRAME object or a new GROUPBOX object is open for debate. If we did decide go with a GROUPBOX object - it would be totally 100% compatible with the FRAME object - one would just have to replace the string FRAME with GROUPBOX in ones script. Only thing is - it wouldn't be TRANSPARENT.

But I guess we shouldn't lose site of one thing - this "bug" only appears when one dynamically creates or moves a control within a FRAME object - and only after the form has been realized. I don't think that this bug would appear in usual everyday usage. One doesn't see too many Windows apps with buttons and textboxes flying around all over the place. Plus - the fixed REFRESH method on the FORM object should work to mitigate this problem.

But it just bugs me that this problem is there - know what I mean ?

So yeah - I have no plans to obsolete the FRAME object ... in fact, when I want grouped controls ... I structure and host them in FRAMES just like you. When the FRAME moves, I want the controls to go with them. But at the same time, we have folks that use FRAMES in a different way - just for visual effect.

We (i) have to think more on how we can deal with this situation. All the green-lighting aside - think my preference is to just leave things as they are right now ... put out 2.0.4 with fixed refresh ... and continue to work on making the FRAME a more intelligent flexible control ... one idea is to add a new property that will set the FRAME background to TRANSPARENT or OPAQUE ... this wouldn't fix the problem - it would just hide it because a transparent FRAME would still behave in this fashion. But it would buy some time until the SMART FRAME was developed.

[ 12. September 2002, 18:36: Message edited by: Shawn ]

Top
#87790 - 2002-09-12 07:26 PM Re: KixForms 2.0.3 form resize issue
Shawn Administrator Offline
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
#87791 - 2002-09-12 08:17 PM Re: KixForms 2.0.3 form resize issue
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Sorry to keep rambling on about this ... I ammended the script just prior to this thread to demonstrate (to myself anyways) that this problem only applies to moving controls within frames ... and to underline the "neat-ness" (?!) of creating controls as children of the frame ... added (yet) another button to dynamically move the entire frame ... no problem as long as there are no controls underneath the frame. If there are - the same problem still applies (frame refresh).

This script will prove usefull in testing ...

Top
Page 1 of 2 12>


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 515 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.075 seconds in which 0.025 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org