#209528 - 2014-10-16 04:03 PM
Re: MessageBox() font
[Re: Allen]
|
Lipman
Fresh Scripter
Registered: 2005-05-09
Posts: 43
Loc: Jersey Shore USA
|
Thanx - I had to ask.
|
Top
|
|
|
|
#209529 - 2014-10-16 04:09 PM
Re: MessageBox() font
[Re: Lipman]
|
Mart
KiX Supporter
Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
|
An example.
Break On
$System = CreateObject("Kixforms.System")
If Not $System
$nul= MessageBox("KiXforms.Net Not Initiated. This Script Will Now Close.","Error",16)
Quit()
EndIf
$nul = $System.Application.EnableVisualStyles
$Form1 = $System.Form()
$Form1.Left = 0
$Form1.StartPosition = 0 ;FormStartPosition_Manual
$Form1.Size = $System.Size(1083,329) ;(Width,Height)
$Form1.Text = "Form1"
$Form1.Top = 0
$Label1 = $System.Label()
$Label1.Font = $System.Font("Verdana",8.25,0) ;Regular
$Label1.Left = 40
$Label1.Text = "Small Verdana"
$Label1.Top = 40
$nul = $Form1.Controls.Add($Label1)
$Label2 = $System.Label()
$Label2.Font = $System.Font("Arial Narrow",12,0) ;Regular
$Label2.Left = 40
$Label2.Text = "Medium Arial"
$Label2.Top = 70
$nul = $Form1.Controls.Add($Label2)
$Label3 = $System.Label()
$Label3.Font = $System.Font("Times New Roman",20.25,0) ;Regular
$Label3.Height = 40
$Label3.Left = 40
$Label3.Text = "Large Times new roman"
$Label3.Top = 100
$Label3.Width = 310
$nul = $Form1.Controls.Add($Label3)
$Label4 = $System.Label()
$Label4.Font = $System.Font("Courier New",72,0) ;Regular
$Label4.Height = 120
$Label4.Left = 40
$Label4.Text = "Huge Courier new"
$Label4.Top = 150
$Label4.Width = 1010
$nul = $Form1.Controls.Add($Label4)
$Form1.Show ;Displays the Form
While $Form1.Visible
$Nul = Execute($Form1.DoEvents())
Loop
Exit 0
_________________________
Mart
- Chuck Norris once sold ebay to ebay on ebay.
|
Top
|
|
|
|
#209653 - 2014-11-17 01:06 PM
Re: MessageBox() font
[Re: BillBarnard]
|
BillBarnard
Starting to like KiXtart
Registered: 2007-03-14
Posts: 141
Loc: Leighton Buzzard, Bedfordshire...
|
Is this a bug in Kixforms graphics? I'm trying to plot single points, but there isn't a function to do this, .point($x,$y) only reads the colour of a pixel. So I tried using .line($x, $y, $x, $y) but nothing actually gets plotted.
$system = CreateObject("kixtart.system")
If Not $System
$nul= MessageBox("KiXtart.Net Not Initiated. This Script Will Now Close.","Error",16)
Quit()
EndIf
$form = $system.form()
$form.top = 0
$form.left = 0
$form.width = 1024
$form.height = 768
$form.text = "TestLine.kix WFB " + @time + " " +@date
$form.show
$form.drawwidth = 1
For $i = 0 to 100
$form.line($i, $i, $i, $i)
next
While $form.visible
$ = Execute($form.doevents())
Loop
Return
The above produces no visible line, unless you increase .drawwidth to 2 and then you get a line plotted of width 1. Weird! Does the .line() object miss plotting the start or end pixel of a line? Regards,
_________________________
Bill
|
Top
|
|
|
|
#209654 - 2014-11-17 01:43 PM
Re: MessageBox() font
[Re: BillBarnard]
|
BillBarnard
Starting to like KiXtart
Registered: 2007-03-14
Posts: 141
Loc: Leighton Buzzard, Bedfordshire...
|
Also:- $form.rectangle($I, $I, 1, 1) Doesn't plot anything. Whereas:- $form.circle($I, $I, 1) Plots more than a pixel. How can I plot single points/pixels please? I also want to be able to plot arcs, which the old QBasic Circle command used to do.
Ok SORTED !
With trial and error I have discovered there is a PSET($x,$y) function. Can't find any documentation on this, I searched through kixforms.dll with a hex editor to look for text string containing "plot" and "set". Regards,
_________________________
Bill
|
Top
|
|
|
|
#209655 - 2014-11-17 02:12 PM
Re: MessageBox() font
[Re: BillBarnard]
|
BillBarnard
Starting to like KiXtart
Registered: 2007-03-14
Posts: 141
Loc: Leighton Buzzard, Bedfordshire...
|
Hi All, Just to finish, I'll show you the code that works for me to plot circles and ellipses. It can be easily modified to produce arcs of circles and ellipses.
$system = CreateObject("kixtart.system")
If Not $System
$nul= MessageBox("KiXtart.Net Not Initiated. This Script Will Now Close.","Error",16)
Quit()
EndIf
$form = $system.form()
$form.top = 0
$form.left = 0
$form.width = 1024
$form.height = 768
$form.text = "TestLine.kix WFB " + @time + " " +@date
$form.show
$form.drawwidth = 1
For $i = 0 to 100
$form.pset($i, $i)
Next
$math = $system.math()
$pi = $math.pi
$2pi = 2.0 * $pi
Circle(200,200,50)
Ellipse(300,300,50,35)
While $form.visible
$ = Execute($form.doevents())
Loop
Return
Function Circle($x, $y, $r)
$t = 0.0
While $t < $2pi
$xx = $math.cos($t) * $r + $x
$yy = $math.sin($t) * $r + $y
$form.pset($xx,$yy)
$t = $t + 0.01
Loop
EndFunction
Function Ellipse($x, $y, $h, $v)
$t = 0.0
While $t < $2pi
$xx = $math.cos($t) * $h + $x
$yy = $math.sin($t) * $v + $y
$form.pset($xx,$yy)
$t = $t + 0.01
Loop
EndFunction
I hope this is useful to someone. Cheers,
_________________________
Bill
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 248 anonymous users online.
|
|
|