Page 2 of 3 <123>
Topic Options
#89234 - 2002-11-06 03:21 PM Re: KiXforms - Version 2.1.2 (Build 36) Released
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
One should be able to place a PictureBox in a frame, I just ran a modified version of the above script with these amendments:

code:
$prgStatus = $fraStatus.PictureBox
$prgStatus.BackColor = IndianRed
$prgStatus.BorderStyle = 2

Seemed to work ok ... We definitely need a new and improved FRAME for Kixforms ... think we already discussed this refreshing issue in the past. j, might want to verify your issue by "wiping" other windows over your form. Or by minimizing then maximizing the form.

Top
#89235 - 2002-11-06 03:33 PM Re: KiXforms - Version 2.1.2 (Build 36) Released
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6372
Loc: Stuttgart, Germany
hmm ... think we got back on the god olde child form track :

No way to wrap a frame around my cards selection thing [Frown]

{edit}
Sorry , even fails on parent form

If i size the frame smaller in height as the shown cards they will appear below but the frame seems to be drawn as a 'solid' element

Will mail you the test script (place it in the hearts folder)
{/edit

[ 06. November 2002, 15:44: Message edited by: jpols ]
_________________________



Top
#89236 - 2002-11-06 03:53 PM Re: KiXforms - Version 2.1.2 (Build 36) Released
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6372
Loc: Stuttgart, Germany
Ah ... and congrats on the 4th Millenium post [Eek!]

J.
_________________________



Top
#89237 - 2002-11-06 04:10 PM Re: KiXforms - Version 2.1.2 (Build 36) Released
Wizard Offline
Hey THIS is FUN
*****

Registered: 2000-12-05
Posts: 264
Loc: Bristol, England
Shawn, here's an idea, why not make the frame object a non-containing (for want of a better word).

ie, You can't add items within a frame object only a form object.

I know this is against VB, but it might save you alot of work.

W
_________________________
Wizard
There's no place like 127.0.0.1

vb | kix | batch | html | cfm | js | english

Top
#89238 - 2002-11-06 04:42 PM Re: KiXforms - Version 2.1.2 (Build 36) Released
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Well, I will give some background in terms of what the problem is. The problem is that I'm trying to support two different ways of showing child controls in a frame.

1) Some folks create controls that are children of the form, then use a frame to visually group the controls. In this case, the frame must be totally transparent so that the child controls can be seen. If the frame is moved, the child controls do not move with. Plus, RadioButtons that are grouped this way are not mutually exclusive by default.

2) Other folks create controls that are children for the frame. In this scenario, the frame doesn't have to be transparent and if the frame is moved, the child controls move with it. RadioButons grouped in this fashion are mutually exclusive by default.

The second option is actually the one I had in mind for proper usage of a frame. If you actually look at VB .FRM statements, child controls "appear" to be children of the frame, and not the form. They seem to be created in a nested fashion.

So what I did, when I created Kixforms v2, was to make the frame non-transparent. The refreshing issue as we see it now, was not a problem. Plus, one could actually set the BackColor of a frame if one wanted. But - when I went back over some legacy scripts that I had - found some scripts that did things "the other way" and the frame hid all the controls underneath.

So caught between a rock and a hard-place right now. Its important to realize that BOTH methods are correct. For example in regular C++ dialogs, the child controls placed in a frame are not children of the frame, they are owned by the dialogbox itself. The frame is just used for visual grouping. The difference is that one doesn't noramally see controls appear and vanish on the fly - plus, C++ dialogs are statically declared and built before they are shown - with Kixforms and Kixtart scripting - the controls are built on the fly - thus we sometimes see them move and flash in certain circumstances. Thats why we usually defer showing the form until just before the DoEvents loop - to keep things hidden until the form is fully rendered.

To change the FRAME behavior this late in the game might be a mistake. The other option you might want to explore is to use the PictureBox object - which can also act as a container. To be honest - the PictureBox object is a FORM ... diff being that its owned by the parent form - its really a borderless sub-form. It has a persistent bitmap background just like a regular form, and can host child controls.

The next best option is to explore a new type of container control - which I've already started to do. dotnet has an object called a "PANE" with behave very much like a frame (its the dotnet version of a frame - its also called a GROUPBOX in some other circles) - the discussion will really center around whether this new control wil REQUIRE that the contained controls be created as children of the pane. My take is that this should be a requirement.

[ 06. November 2002, 16:43: Message edited by: Shawn ]

Top
#89239 - 2002-11-06 04:50 PM Re: KiXforms - Version 2.1.2 (Build 36) Released
Wizard Offline
Hey THIS is FUN
*****

Registered: 2000-12-05
Posts: 264
Loc: Bristol, England
I am a VB programmer mainly and I do use the second method - but only because it is easier to move a group of object around the screen quickly with drag'n'drop.

I will fully support any choice you make.!

I think I'll just keep my progress bar visible.! [Smile]

W
_________________________
Wizard
There's no place like 127.0.0.1

vb | kix | batch | html | cfm | js | english

Top
#89240 - 2002-11-06 06:02 PM Re: KiXforms - Version 2.1.2 (Build 36) Released
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
yeah, i always use the frame child thingy to - mostly because I always end up moving and adjusting and tweaking the form afterwards, its a whole lot easier to just re-position the frame, then have to re-calculate all the child controls as well. here's the picturebox version of the script. it would simulate (pretty closely) how a dotnet pane object would behave (except for the etched border and caption, which isn't there) - but you could draw your own if you wanted ...

HEY Wiz - How about getting a little splash of color in those forms of yours, eh ? I always get much high praise from Jochen for my splendid use of color - right J ?

code:
Break On

$frmMain = CreateObject("Kixtart.Form")
$frmMain.Size = 400,200
$frmMain.SysMenu = 0
$frmMain.Text = "Welcome to the @DOMAIN Domain"
$frmMain.Center
$frmMain.BackColor = MediumAquaMarine

$fraStatus = $frmMain.PictureBox
$fraStatus.BackColor = IndianRed
$fraStatus.Location = 10,10
$fraStatus.Right = $frmMain.ClientWidth - 10
$fraStatus.Bottom = 0.70 * $frmMain.ClientHeight - 10
$fraStatus.Text = " Progress "

$prgStatus = $fraStatus.ProgressBar
$prgStatus.BackColor = Khaki
$prgStatus.ForeColor = $frmMain.BackColor
$prgStatus.BorderStyle = 2
$prgStatus.Size = 260, 17
$prgStatus.Center
$prgStatus.Style = 1
$prgStatus.Top = 40

$btnDo = $frmMain.Button
$btnDo.Text = "Do"
$btnDo.OnClick = "btnDo_Click"
$btnDo.Center
$btnDo.Top = $fraStatus.Bottom + 10

Function btnDo_Click
$prgStatus.Visible = Not $prgStatus.Visible
If $prgStatus.Visible
For $i = 0 to $prgStatus.Max
$prgStatus.Value = $i
Sleep 0.010
Next
$prgStatus.Value = 0
EndIf
EndFunction

$frmMain.Center
$frmMain.Show
While $frmMain.Visible
$=Execute($frmMain.DoEvents)
Loop


Top
#89241 - 2002-11-06 06:14 PM Re: KiXforms - Version 2.1.2 (Build 36) Released
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Plus don't forget, there is a whole suite of powerfull graphic functions built into Kixforms for desiging custom controls, fe. don't like how the frame object looks - just design your own using the generic PictureBox control with a custom paint job [Wink] :

code:
Break On

$frmMain = CreateObject("Kixtart.Form")
$frmMain.Size = 400,200
$frmMain.SysMenu = 0
$frmMain.Text = "Welcome to the @DOMAIN Domain"
$frmMain.Center
$frmMain.BackColor = MediumAquaMarine

$fraStatus = $frmMain.PictureBox
$fraStatus.BackColor = $frmMain.BackColor
$fraStatus.BorderStyle = 0
$fraStatus.Location = 10,10
$fraStatus.Right = $frmMain.ClientWidth - 10
$fraStatus.Bottom = 0.70 * $frmMain.ClientHeight - 10
$fraStatus.ForeColor = DarkGreen
$fraStatus.FontBold = 1
$fraStatus.Rectangle(0,7,$fraStatus.ClientWidth-7,$fraStatus.ClientHeight-7)
$fraStatus.ForeColor = Blue
$fraStatus.FontTransparent = False
$fraStatus.PrintXY(5,0," Caption ")

$prgStatus = $fraStatus.ProgressBar
$prgStatus.BackColor = Khaki
$prgStatus.ForeColor = $fraStatus.ForeColor
$prgStatus.BorderStyle = 2
$prgStatus.Size = 260, 17
$prgStatus.Center
$prgStatus.Top = 40

$btnDo = $frmMain.Button
$btnDo.Text = "Do"
$btnDo.OnClick = "btnDo_Click"
$btnDo.Center
$btnDo.Top = $fraStatus.Bottom + 10

Function btnDo_Click
For $i = 0 to $prgStatus.Max
$prgStatus.Value = $i
Sleep 0.010
Next
$prgStatus.Value = 0
EndFunction

$frmMain.Center
$frmMain.Show
While $frmMain.Visible
$=Execute($frmMain.DoEvents)
Loop



[ 06. November 2002, 18:15: Message edited by: Shawn ]

Top
#89242 - 2002-11-06 06:41 PM Re: KiXforms - Version 2.1.2 (Build 36) Released
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
And - if I may be so bold - I think the script that opitimizes the power of a custom paint job is in the yet unpublished (but infamous) RatProgressBar created by one NTDOC (aka Ron). Hopefully, if he reads this far, he will correct this oversight on his part. [Wink]
Top
#89243 - 2002-11-07 02:08 AM Re: KiXforms - Version 2.1.2 (Build 36) Released
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11567
Loc: CA
I'll look for it at home tonight and post it. :-)
Top
#89244 - 2002-11-07 04:02 AM Re: KiXforms - Version 2.1.2 (Build 36) Released
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11567
Loc: CA
Here is the RatProgressBar Shawn was speaking of.

code:
Break On

$Form = CreateObject("Kixtart.Form")

$Form.ScaleWidth = 300
$Form.ScaleHeight = 200
$Form.FontSize = 12

$Form.BackColor = 128,128,255

$Form.ForeColor = 0,0,255
$Form.FillColor = $Form.ForeColor

$Form.FillStyle = 1

$Form.Circle(26,30,40)
;$Form.Rectangle(27,10,110,40)
$Form.Circle(133,30,40)
$Form.Circle(80,80,50)

$Form.ForeColor = 255,255,255
$Form.FontName = "Comic Sans MS"
$Form.FontSize = 24
$Form.FontBold = 1
$Form.PrintXY(25,25,"Mickey")
$Form.FontSize = 12
$Form.FontBold = 0


$PBar = $Form.ProgressBar
$PBar.Size = 280,30
$PBar.Location = 10,140
$PBar.Max = 100
$PBar.Value = 50
$PBar.ForeColor = 150,255,150

$Form.Center
$Form.Show

While $Form.Visible
$=Execute($Form.DoEvents)
Loop

Exit 1


Top
#89245 - 2002-11-07 04:10 AM Re: KiXforms - Version 2.1.2 (Build 36) Released
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Does that come with a copyright release? [Big Grin]
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#89246 - 2002-11-07 08:52 AM Re: KiXforms - Version 2.1.2 (Build 36) Released
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6372
Loc: Stuttgart, Germany
just a fyi Shawn,

I managed to build that card select thing into a frame by making the frame a child of PictureBox,
wonder though why I had to make the rectangle drawing child of the form, but hey, it works now

J.
_________________________



Top
#89247 - 2002-11-08 12:07 AM Re: KiXforms - Version 2.1.2 (Build 36) Released
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6372
Loc: Stuttgart, Germany
Another thing for the update list :

Experienced that vertical alignment for labels is always Top, this is a bit disturbing when using labels as fake status bars ...

How about making default VAlign to center or even add a .VerticalAlignment property ?

J.
_________________________



Top
#89248 - 2002-11-08 12:12 AM Re: KiXforms - Version 2.1.2 (Build 36) Released
Wizard Offline
Hey THIS is FUN
*****

Registered: 2000-12-05
Posts: 264
Loc: Bristol, England
J, could you not just change the .TOP value of the label to keep it in line, or am I missing something ?

W
_________________________
Wizard
There's no place like 127.0.0.1

vb | kix | batch | html | cfm | js | english

Top
#89249 - 2002-11-08 12:17 AM Re: KiXforms - Version 2.1.2 (Build 36) Released
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6372
Loc: Stuttgart, Germany
That would fit if the label itself has no border, true !

Just take a look at Shawns Kiwi script bottom of the form

Jochen
_________________________



Top
#89250 - 2002-11-08 12:27 AM Re: KiXforms - Version 2.1.2 (Build 36) Released
Wizard Offline
Hey THIS is FUN
*****

Registered: 2000-12-05
Posts: 264
Loc: Bristol, England
yeap, it was me missing something.! sorry.

I see your point now.

Yes, can we have a .valign tag please.

W
_________________________
Wizard
There's no place like 127.0.0.1

vb | kix | batch | html | cfm | js | english

Top
#89251 - 2002-11-07 02:15 PM Re: KiXforms - Version 2.1.2 (Build 36) Released
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
j, ok im with you now ... well spotted - I will add the following new property:

$Object.TextAlign = Number
Gets or sets the alignment of text in the label.

Number
One of the following values:

0 - TopLeft (Default)
1 - TopCenter
2 - TopRight
3 - MiddleLeft
4 - MiddleCenter
5 - MiddleRight
6 - BottomLeft
7 - BottomCenter
8 - BottomRight

[ps] This is an example from some of the new documentation Im putting together ... the work is progressing very slowly because I'm trying to juggle work/family/development and docs all at the same time - sure everyone here knows the story ...

Top
#89252 - 2002-11-07 02:57 PM Re: KiXforms - Version 2.1.2 (Build 36) Released
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Ooh, yeah. Almost forgot about that alignment thingy. Asked for that way back. Glad to see it.

Ron, love the Rat Progressbar.

Top
#89253 - 2002-11-07 03:13 PM Re: KiXforms - Version 2.1.2 (Build 36) Released
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Doc - glad you got a sense of humour !

Chris - I remember that discussion we had. Not too sure if you noticed or not - but I purposely re-arranged the proposed TextAlign enumerations to be different then the current Alignment enums. Alignment has only three values, like this:

0 - Left
1 - Right
2 - Centered

and TextAlign starts like this:

0 - TopLeft
1 - TopCentered
2 - TopRight

It would have been "better" imho to make the first three values of the new TextAlign property "line-up" with the old Alignment property ... just cause (i) memorized the settings ... but, I think the new TextAlign is more intuitive and easily remembered, one can visualize a 3x3 grid and the numbers lineup from left to right, top to bottom (know what I mean?).

Top
Page 2 of 3 <123>


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

Who's Online
0 registered and 35 anonymous users online.
Newest Members
thequeen, ameliaryan, shalomsalami, dkdssdk, Vroon
17639 Registered Users

Generated in 0.041 seconds in which 0.011 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