Page 1 of 1 1
Topic Options
#92189 - 2003-06-12 11:42 PM KiXforms: TabControl Sample
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Here is a sample script that Shawn wrote that demos the new TabControl.

What is cool about this is that you can "reuse" variable names in this context without destroying the object. The magic is that each TabPage is indexed under the TabControl.



Break On

$Form = CreateObject("Kixtart.Form")
$Form.FormBorderStyle = 4
$Form.ClientSize = 500,300

$TabControl = $Form.Controls.TabControl
$TabControl.Size = $Form.ClientSize
$TabControl.Anchor = 15
$TabControl.OnSelectedIndexChanged = "OnTabControlSelectedIndexChanged()"

For $i = 0 to 20
 $TabPage = $TabControl.TabPages.Add($i)
 $ListView = $TabPage.Controls.ListView
 $ListView.Size = $TabPage.ClientSize
 $ListView.Anchor = 15
 $ListView.GridLines = 1
 $ListView.Columns.Count = 10
 For $j = 0 to 10
  $Item = $ListView.Items.Add($j)
  For $k = 0 To $ListView.Columns.Count - 1
   $Item.SubItems($k).Text = $k
  Next
 Next

 $ListView.Name = "ListView"
 $ListView.Tag = "This is listview #$i"

Next

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

Exit 1

Function OnTabControlSelectedIndexChanged()

 If $TabControl.SelectedIndex <> -1

  $ListView = $TabControl.TabPages($TabControl.SelectedIndex).Controls("ListView")

  $Form.Text = $ListView.Tag

 EndIf
EndFunction


Top
#92190 - 2003-06-16 02:07 PM Re: KiXforms: TabControl Sample
Will Hetrick Offline
Hey THIS is FUN

Registered: 2001-10-02
Posts: 320
Loc: Harrisburg, PA USA
Chris,
On this one, I get a 15 then a 1 on the console.
After that, It quits.
What is gonig on? Do I need a new version of Kixforms?
_________________________
You have at least 2 choices. Each choice changes your destiny. Choose wisely!

Top
#92191 - 2003-06-16 02:21 PM Re: KiXforms: TabControl Sample
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6372
Loc: Stuttgart, Germany
The most likely reason is that you don't use the latest kixforms build that is build 40 aka. 2.3.0 Beta 2

get that here

Hey, nice sample btw. [Big Grin]

[ 16. June 2003, 14:24: Message edited by: Jochen ]
_________________________



Top
#92192 - 2003-06-16 03:16 PM Re: KiXforms: TabControl Sample
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Yeah, sorry. I failed to mention that this sample requires the latest beta of KiXforms.
Top
#92193 - 2003-12-05 01:45 PM Re: KiXforms: TabControl Sample
1984 Offline
Starting to like KiXtart

Registered: 2003-08-14
Posts: 150
Im Using KiXforms_230b3.
Got "Runtime-error.The Form object does not support the Count property or method"

What 2 do ?
_________________________
"... Great minds talk about idea' s, average minds talk about events and samll minds talks about people...!"

Top
#92194 - 2003-12-05 02:37 PM Re: KiXforms: TabControl Sample
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Sounds like your still not running the lastest version. When you regsvr32 the DLL, make sure to fully qualify the pathname, like this:

regsvr32 c:\tools\kixforms.dll

or whatever your path is. If you are able to get a form running, left click the app icon in top left corner of the title bar, and click "about..." - make sure the build is 2.3.0.41 ...

-Shawn

Top
#92195 - 2003-12-05 05:10 PM Re: KiXforms: TabControl Sample
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11564
Loc: CA
It is highly recommended to get in the habit of properly unregistering and re-registering DLL files.

Yes you would probably not experience any issue with KiXforms DLL by just overwriting it, but the preferred method is to run

Unregister
regsvr32 /u kixforms.dll

Register
regsvr32 kixforms.dll

That can be run from the RUN command on the start menu so only takes less then a second.


Yes one can place a DLL in the installation folder, but that is not a best practice method. DLL files should be located in %WINDIR%\SYSTEM32

Top
#92196 - 2003-12-05 06:58 PM Re: KiXforms: TabControl Sample
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
By not unregistering and re-registering a DLL properly, you will not be able to access new methods that are in the new DLL but not in the DLL that was previously registered.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#92197 - 2003-12-06 05:28 AM Re: KiXforms: TabControl Sample
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Both Doc and Howard are correct.

The point being here is that with new functionality there are new "calls" to these new methods. They need to be regsistered to show.

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#92198 - 2003-12-06 05:41 PM Re: KiXforms: TabControl Sample
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22332
Loc: OK
heh.
the unregister is only needed when the functionality is ripped out.
as far as I understand how the reg is handled.
anyway, with kixforms, can't try that... well, without registering a really old build over new one.
_________________________
!

download KiXnet

Top
#92199 - 2003-12-06 05:59 PM Re: KiXforms: TabControl Sample
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
COM Objects designed just for scripting purposes only are more forgiving to just overlaying the DLL and not re-registering. But when new functionality in terms of new objects are added, re-registering is a good thing and prob required. If just Automation methods and properties have been added, overlaying works ok (do it all the time). Like Jooel says, if objects have been ripped-out, un-registering should be done to clean up. But mostly that doesn't happen.

Top
#92200 - 2003-12-06 10:02 PM Re: KiXforms: TabControl Sample
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11564
Loc: CA
But as an END USER of any software not written by ones self, you usually have no idea what the author has done inside the code behind the DLL. Thus, unregister, re-register (about 1 second of time) is much easier and should ensure less possibility of encountering an issue.
Top
#92201 - 2003-12-06 10:25 PM Re: KiXforms: TabControl Sample
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
Yes, just make it a "best practice" to un/re-register COM-DLLs if they've been changed.
_________________________
There are two types of vessels, submarines and targets.

Top
#92202 - 2003-12-07 12:24 AM Re: KiXforms: TabControl Sample
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22332
Loc: OK
until you start to wrap up installers and selling your exe, that is NEVER a best-practise.
why to do hard of an simple thing?

everyone who ever uses dll in his script, as example, kixforms.dll, knows where is going.
and if he/she ever does a package where he is unsure what is happening, he might do unreg/reg...

but for about 99,99999999% it's unneeded.
_________________________
!

download KiXnet

Top
Page 1 of 1 1


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

Who's Online
1 registered (adamlevine) and 165 anonymous users online.
Newest Members
katherinknul, phamthuy, xuantu075, skygreen2031, amelindarķe
17629 Registered Users

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

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