Lipman
(Fresh Scripter)
2014-10-16 01:47 PM
MessageBox() font

Is there anyway I can control the font in a MessageBox() Pop-Up ?

Font selection and Font size in particular.


AllenAdministrator
(KiX Supporter)
2014-10-16 02:47 PM
Re: MessageBox() font

short answer no. using kixforms you can create your own.

Lipman
(Fresh Scripter)
2014-10-16 04:03 PM
Re: MessageBox() font

Thanx - I had to ask.



Mart
(KiX Supporter)
2014-10-16 04:09 PM
Re: MessageBox() font

An example.

 Code:
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


Lipman
(Fresh Scripter)
2014-10-16 04:16 PM
Re: MessageBox() font

Thank you.

I guess one of these days I'll have to learn Kixforms and apply it.

After 20+ years of using KiXtart I guess I am used to it being without it. Maybe that should change.


ShaneEP
(MM club member)
2014-10-17 08:09 PM
Re: MessageBox() font

Kixforms is an amazing tool in my opinion. Really opens up a lot of possibilities. Have written several full GUI 'applications' with just kix and kixforms.

Lipman
(Fresh Scripter)
2014-10-20 01:22 AM
Re: MessageBox() font

Aye...

BillBarnard
(Starting to like KiXtart)
2014-11-03 12:03 PM
Re: MessageBox() font

Kixforms 2.47.5.0 needs a good help file, or a manual with examples, so that all of its graphics functions are documented and explained.
Kixforms.Net 3.1.46.0 could also do with a manual with examples.
I want to draw points, lines, circles, rectangles and ellipses (some filled) and query the colour/value of a graphics pixel/point.
Are these available in the old 2.47.5.0 version?
The .chm file for the .Net version does not include examples.
Regards,


LonkeroAdministrator
(KiX Master Guru)
2014-11-04 01:23 AM
Re: MessageBox() font

Bill, not completely true.
we didn't at the time document everything all that deeply but if you look at DNS or TCPListener you should find examples in both. Or filestream.


BillBarnard
(Starting to like KiXtart)
2014-11-10 11:07 AM
Re: MessageBox() font

Thanks Lonkero,
I also found good examples in Shawn Tassie's KixPixasoPainter.kix
Cheers,


BillBarnard
(Starting to like KiXtart)
2014-11-10 11:18 AM
Re: MessageBox() font

Where can I find DNS and TCPListener and filestream please?
Can't find them in the UDF list.
If it's on Glenn's website, then http://www.innotechcg.com is giving errors today.
Cheers,


Glenn BarnasAdministrator
(KiX Supporter)
2014-11-10 07:11 PM
Re: MessageBox() font

I only have 3 KF-specific UDFs on my site.. kfNFSLookup, kfPing, and kfVer. I haven't used any public UDFs for my Sockets-based code.

Site's up - you probably hit it when the SQL server was getting patched.

Glenn


BillBarnard
(Starting to like KiXtart)
2014-11-10 10:22 PM
Re: MessageBox() font

Thanks Glenn, yes the your site is OK now.
Cheers,


BillBarnard
(Starting to like KiXtart)
2014-11-17 01:06 PM
Re: MessageBox() font

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.
 Code:
$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,


BillBarnard
(Starting to like KiXtart)
2014-11-17 01:43 PM
Re: MessageBox() font

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,


BillBarnard
(Starting to like KiXtart)
2014-11-17 02:12 PM
Re: MessageBox() font

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.
 Code:
 
$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,