KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

MaskedTextBox <> TextBox
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    KiXforms Forum Index -> Discussion
View previous topic :: View next topic  
Author Message
Floyd
KiXforms Supporter
KiXforms Supporter


Joined: 21 Apr 2004
Posts: 78

PostPosted: Thu Jun 08, 2006 6:58 pm    Post subject: MaskedTextBox <> TextBox Reply with quote

Hey Shawn and kf dudes,

Is the below code working properly for you?

I get some strange behavior, with MaskedTextBox. reveres TextBox.
It worked before with first devbuild release included MaskedTextBox.

But now when I run it with devbuild 2.46.54.0. It’s a mess-up….

Enter a “Free” value and the change index to IP, Click on TextBox and it jumps back to ”Free” mode with previously value….

Is this forms or kix problem… maybe some variable handling problem….

Env:
Kix 4.52.0.0.
Forms 2.46.54.0
W2K SP4


Code:


Break On

$System = CreateObject("Kixtart.System")

$Form = $System.Form
$Form.Size = 400,200


$MaskComboBox = $Form.Controls.Add("ComboBox")
$MaskComboBox.Left = 25
$MaskComboBox.Top = 35
$MaskComboBox.Right = $Form.ClientWidth - 45
$MaskComboBox.Text = "Mask"
$MaskComboBox.OnSelectedIndexChanged = "SetMaskButton_Click()"

$Masks =
   "Free",
   "IP Add.",
   "MAC"
   
For Each $Mask in $Masks
 $= $MaskComboBox.AddItem($Mask)
Next

$MaskComboBox.ListIndex = 0

SetMaskButton_Click()


$Form.Center
$Form.Show

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

Exit 0


Function SetMaskButton_Click()


If $MaskComboBox.Text = "Free"

     $TextBox = $Form.Controls.Add("TextBox")
   $TextBox.Left = 25
   $TextBox.Top = 75
   $TextBox.Right = $Form.ClientWidth - 45
   $TextBox.Focus
   
EndIf

If $MaskComboBox.Text = "IP Add."

    $MaskedTextBox = $Form.Controls.Add("MaskedTextBox")
   $MaskedTextBox.Left = 25
   $MaskedTextBox.Top = 75
   $MaskedTextBox.Right = $Form.ClientWidth - 45
    $MaskedTextBox.Mask = "999.999.999.999"
    $MaskedTextBox.Focus
   
EndIf

If $MaskComboBox.Text = "MAC"

    $MaskedTextBox = $Form.Controls.Add("MaskedTextBox")
   $MaskedTextBox.Left = 25
   $MaskedTextBox.Top = 75
   $MaskedTextBox.Right = $Form.ClientWidth - 45
    $MaskedTextBox.Mask = "[0-f][0-f]-[0-f][0-f]-[0-f][0-f]-[0-f][0-f]-[0-f][0-f]-[0-f][0-f]"
    $MaskedTextBox.Focus
   
EndIf


EndFunction

Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Thu Jun 08, 2006 8:38 pm    Post subject: Reply with quote

Well, I can see whats going on ... whats happening is that the first textbox isn't being "destroyed". and you actually got a MaskedTextBox over-laying the old TextBox ... somehow the textbox is coming to the foreground when one selects "it" ...

Having said that, what you (we) need to do is to be able to really destroy the old textbox, which (I just realized) aint easy to do when one uses this syntax to create it in the first place:

$TextBox = $Form.Controls.TextBox
-or-
$TextBox = $Form.Controls.Add("TextBox")

It is much easier to destroy it when you use this syntax:

$TextBox = $Form.TextBox

Which is maybe how you were doing "it" before ?

I am going to make a small change to the development build to properly destroy the control. Going to add the Controls.Remove method. Things should behave much better after that.

-Shawn


Last edited by Shawn on Fri Jun 09, 2006 1:30 am; edited 1 time in total
Back to top
View user's profile Send private message
Lonkero
KiXforms Devotee
KiXforms Devotee


Joined: 13 Mar 2003
Posts: 1022
Location: Espoo, Finland

PostPosted: Thu Jun 08, 2006 9:48 pm    Post subject: Reply with quote

is this already in there in kf.net?
_________________
Hammer
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Fri Jun 09, 2006 1:29 am    Post subject: Reply with quote

Ja it is.
Back to top
View user's profile Send private message
Floyd
KiXforms Supporter
KiXforms Supporter


Joined: 21 Apr 2004
Posts: 78

PostPosted: Mon Jun 12, 2006 10:35 am    Post subject: Reply with quote

Aha! That’s why! ….

I think the problem occurred when I changed from standard method - $Form.Control - to short $Form.Control(“”,,,,). This to keep the code lines at minimum...

However, this has now resulted in very annoying strange behavior, which I cannot manage to undo…

Look at the attached image.
You’ll see how the form background image has been corrupted as result.
Somehow the part of background image is pushed to the right...

And even more stranger thing is that it doesn’t matter if I roll back and using pervious format.
It will persist corrupted! My project GUI is now a mess-up. Crying or Very sad

Need your help Shawn



bug.png
 Description:
 Filesize:  19.49 KB
 Viewed:  1768 Time(s)

bug.png


Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Mon Jun 12, 2006 12:56 pm    Post subject: Reply with quote

Are you saying the GUI is messed-up because of this "control creation" thing, or that its messed-up because of some other (new) reason ?
Back to top
View user's profile Send private message
Floyd
KiXforms Supporter
KiXforms Supporter


Joined: 21 Apr 2004
Posts: 78

PostPosted: Mon Jun 12, 2006 1:44 pm    Post subject: Reply with quote

So far I cannot find any other “new reasons”!

The only changed I done was to change the formats from $Form.Control to short defining method $Form.Control(“”,,,,).

I did this on all controls, TextBox, TooButtons, Lables, TabPage etc.
To avoid separate extra code lines for properties Text, Left, Top, Width, and Height for each control objects.

Even I do roll back, it some how remembers controls, very strange indeed!

Somehow it reminds me about the KFD .NET where “deleted” control objects were not really deleted. They remained in the KFD file…

I have even done another test. I crated new kix file. Then copied only the main form part without any control objects or functions. Add the background image from b64 to the new created form…. And guess what! Same mess-up form GUI!!!!

This drives my crazy … what is going on? Twilight zone!

Code:


Break On

$System = CreateObject("Kixtart.System")

$BGBitmap = $System.Bitmap.FromBase64String(FormImageString())

$Form = $System.Form()
$Form.Size = 900,600
$Form.Font = "Verdana"
$Form.KeyPreview = 1
$Form.BackgroundImage = $BGBitmap
$Form.ShowInTaskBar = 1
$Form.Opacity = 100
$Form.FormBorderStyle = 0
$Form.MaximizeBox = 0
$Form.WindowState = 0
$Form.TopMost = 0
$Form.Icon = 5 

$Form.Center
$Form.Show

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

Exit 0




Is there any way to debug for possible errors?
Is there any hidden controls?
How can controls mess-up a background image on the main form?
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Mon Jun 12, 2006 2:26 pm    Post subject: Reply with quote

Can you post that last test script, with the actual image function (b64 code), as an attachment to your post
Back to top
View user's profile Send private message
Floyd
KiXforms Supporter
KiXforms Supporter


Joined: 21 Apr 2004
Posts: 78

PostPosted: Tue Jun 13, 2006 12:41 pm    Post subject: Reply with quote

sure... you got an email (b64 file and kix code)...

do you see anything wrong?
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Tue Jun 13, 2006 2:12 pm    Post subject: Reply with quote

Not seeing any email ... try stassie at sympatico dot ca
Back to top
View user's profile Send private message
Floyd
KiXforms Supporter
KiXforms Supporter


Joined: 21 Apr 2004
Posts: 78

PostPosted: Tue Jun 13, 2006 3:18 pm    Post subject: Reply with quote

humm... it was send to that address! …
Still no mail?
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Tue Jun 13, 2006 4:09 pm    Post subject: Reply with quote

nothing yet - how about

shawn_tassie at hotmail dot com
Back to top
View user's profile Send private message
Floyd
KiXforms Supporter
KiXforms Supporter


Joined: 21 Apr 2004
Posts: 78

PostPosted: Tue Jun 13, 2006 4:32 pm    Post subject: Reply with quote

Tired One more time... both hotmail and sympatico.ca...

U got it?
Back to top
View user's profile Send private message
Floyd
KiXforms Supporter
KiXforms Supporter


Joined: 21 Apr 2004
Posts: 78

PostPosted: Wed Jun 14, 2006 12:05 pm    Post subject: Reply with quote

Still no mail Shawn?
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Wed Jun 14, 2006 2:01 pm    Post subject: Reply with quote

I got them thanks. For some reason, they all seemed to flood in at once - with date/times hours apart - wierd - anyways thanks - I do have them.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Discussion All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group