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

kixforms designer and the font object...some musings

 
Post new topic   Reply to topic    KiXforms Forum Index -> Discussion
View previous topic :: View next topic  
Author Message
Stevie
KiXforms Supporter
KiXforms Supporter


Joined: 04 Jun 2003
Posts: 109

PostPosted: Wed Jul 02, 2003 8:34 pm    Post subject: kixforms designer and the font object...some musings Reply with quote

Shawn,

We've discussed this before but I want to make sure I'm clear on this one and didn't want to continue a previous thread ad infinitum.

Per that discussion, one can do the following:
Code:
$Drawing = CreateObject("Kixtart.Forms.Drawing")
$Button.Font = $Drawing.Font("Arial", 12, 1)

That drawing object can be used for all objects created by KF that support the font object? Also, what are you using for an enumeration in the last argument, I'm assuming there's normal, bold, italic, etc.

If this works as I suspect it does, then should I go ahead and add a "Font" object type that pops up the font dialog and records that information into the script for each object? I'm not sure we ever came to resolution on this.
________
ALCOHOL REHAB FORUMS


Last edited by Stevie on Fri Feb 18, 2011 8:49 am; edited 1 time in total
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 Jul 02, 2003 9:03 pm    Post subject: Reply with quote

Stevie,

Your a mind reader man because the only thing holding things up (and keeping me awake at night) now is how to best handle the namespaces ...

The $Something.Drawing.Font(...) is a given. Like we discussed, the Font constructor will behave exactly like in dotnet. Might even try for the float in the second parm and definitely FontStyles as third. Dont think (thoughts?) there is a need to support the rest of the crap like GraphicsUnit - font metrics has me reaching for Advil when having to deal with Points let alone other units!

But right now though I'm struggling with how much "compatibility" should be there ... mulling over two options and just doing a bit of play coding to see how it reads ... I want to have a higher namespace that could represent the "System" namespace, than branch out from there ... ideally, would codeup as:

$Form.Font = $System.Drawing.Font("Arial",8.5,<FontStyles>)

Diagnostics would be same:

$Process = $System.Diagnostics.Process.Start(...)

only thing im not really happy with at the moment is the absolute path to get from System to Forms ... and I can see this being usefull (very shortly) because I want to implement Enumerations just like in dotnet. Its long though ...

$Form.FormBorderStyle = $System.Windows.Forms.FormBorderStyle.Sizable

Its a mouthfull, so was playing around with the idea of just using the existing Forms namespace and branch out from that instead, would codeup as:

$Forms = CreateObject("Kixtart.Forms")

$Form.FormBorderStyle = $Forms.FormBorderStyle.Sizeable
$Form.Icon = $Forms.Drawing.Icon(".\myicon.ico")

So $Forms could be the namespace root and $Form is just a form. Still debating ... might just go with the beta as is right now though ...

-Shawn
Back to top
View user's profile Send private message
Stevie
KiXforms Supporter
KiXforms Supporter


Joined: 04 Jun 2003
Posts: 109

PostPosted: Wed Jul 02, 2003 9:18 pm    Post subject: Reply with quote

I see your dilemma.

If you include the full namespace hierarchy it becomes quite burdensome to type over and over. If you don't then it becomes more difficult to map your enumerations directly over to dotnet.

Would it even be worth it to try another dotnet-ism here...

using the Imports statement to simplify the namespaces. Or rather, a kixified version of it. Something as simple as:
$Forms = "$System.Windows.Forms"

That way you could have the best of both worlds. Of course, since I have no idea how you're implmenting KF I don't even know if this approach makes any sense at all.

For the font stuff, I'll definitely start moving to the new way of doing business and I'll just go ahead and use the FontStyles enum in the last param and a float for size in the second.
________
Gm Foods
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
Page 1 of 1

 
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