What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Font Dialog - Enhanced Colour

Font Dialog - Enhanced Colour
Author: Message:
Dempsey
Scripting Contest Winner
*****

Avatar
http://AdamDempsey.net

Posts: 2395
Reputation: 53
37 / Male / Flag
Joined: Jul 2003
O.P. Font Dialog - Enhanced Colour
As you know, Plus! replaces the colour combobox in the standard WLM font dialog, with the 'Enhanced Colour' picker.  And when you change the colour, it updates the colour in the sample frame.

But when you manually create your own Font dialog in a script, Plus! detects the creation of it and subclasses it etc and adds the Enhanced colour picker to that as well, which is ok, except it doesn't update the colour of the sample.  I know this is probably as it's not WLM that created or whatever, but I think one of two things needs to be done.

[list=1]
[*]Dont add the Enhanced colour picker to font dialogs created from scripts
[*]Add it, but also update the sample colour, as it does when WLM shows the dialog
[/list]

Hope Patchou reads this and can give some feeback :)
SoundPacks   -   Scripts   -   Skins

that's not a bug, thats an unexpected feature
08-07-2006 10:57 AM
Profile E-Mail PM Web Find Quote Report
Patchou
Messenger Plus! Creator
*****

Avatar

Posts: 8607
Reputation: 201
43 / Male / Flag
Joined: Apr 2002
RE: Font Dialog - Enhanced Colour
Hey Dempsey,

my guess is that it has something to do with the way you create your font window. Can you send me a sample script that shows the bug? I'll fix it on my side or tell you what's wrong in the code :).

Patch
[Image: signature2.gif]
08-12-2006 05:40 PM
Profile PM Web Find Quote Report
Dempsey
Scripting Contest Winner
*****

Avatar
http://AdamDempsey.net

Posts: 2395
Reputation: 53
37 / Male / Flag
Joined: Jul 2003
O.P. RE: Font Dialog - Enhanced Colour
I'm guessing it's probably because I don't set some parts of the CHOOSEFONT structure correctly, here's the code I use:
code:
function ChooseFont(){
    var CF = Interop.Allocate(60);
    CF.WriteDWORD(0, CF.Size); //lStructSize
    CF.WriteDWORD(4, 0); //hwndOwner
    CF.WriteDWORD(8, 0); //hDC
    var LF = Interop.Allocate(92);
    LF.WriteDWORD(0,0); //lfHeight
    LF.WriteDWORD(4,0); //lfWidth
    LF.WriteDWORD(8,0); //lfEscapement
    LF.WriteDWORD(12,0); //lfOrientation
    LF.WriteDWORD(16,0); //lfWeight
    LF.SetAt(20,0); //lfItalic
    LF.SetAt(21,0); //lfUnderline
    LF.SetAt(22,0); //lfStrikethru
    LF.SetAt(23,0); //lfCharSet
    LF.SetAt(24,0); //lfOutPrecision
    LF.SetAt(25,0); //lfClipPrecision
    LF.SetAt(26,0); //lfQuality
    LF.SetAt(27,0); //lfPitchAndFamily
    LF.WriteString(28, ""); // lfFaceName
    CF.WriteDWORD(12, LF.DataPtr); //LPLF
    var iPointSize = Interop.Allocate(4);
    CF.WriteDWORD(16, iPointSize.DataPtr); //iPointSize
    CF.WriteDWORD(20, CF_INITTOLFSTRUCT | CF_SCREENFONTS | CF_EFFECTS ); //Flags
    CF.WriteDWORD(24, 0); // rgbColors
    CF.WriteDWORD(28, 0); // lCustData
    CF.WriteDWORD(32, 0); // lpfnHook
    CF.WriteDWORD(36, 0); // lpTemplateName
    CF.WriteDWORD(40, 0); // hInstance
    var lpszStyle = Interop.Allocate(514);
    CF.WriteDWORD(44, lpszStyle.DataPtr); // lpszStyle
    CF.WriteWORD(48, 0x2000); // nFontType
    CF.WriteDWORD(50, 0); // nSizeMin
    CF.WriteDWORD(54, 0); // nSizeMax
    var result = Interop.Call("comdlg32.dll", "ChooseFontW", CF);
        if(result > 0){
                Debug.Trace('Font: ' + LF.ReadString(28));
                Debug.Trace('Size: ' + LF.ReadDWORD( 0));
                //var weight = LF.ReadDWORD(16);
                if (LF.ReadDWORD(16) == 700){
                        Debug.Trace('Bold: 1');
                }else{
                        Debug.Trace('Bold: 0');
                }
                Debug.Trace('Italic: ' +LF.GetAt(20));
                Debug.Trace('Underline: ' + LF.GetAt(21));
                Debug.Trace('Strkethru: ' + LF.GetAt(22));
        }else{
                var error = Interop.Call('ComDlg32', 'CommDlgExtendedError');
                if(error > 0){
            LF.WriteDWORD(0,0);
                        //An error occurred, "error" contains the error code
                }else{
            LF.WriteDWORD(0,0);
                        //User closed font dialog
                }
        }
    return LF;
}
SoundPacks   -   Scripts   -   Skins

that's not a bug, thats an unexpected feature
08-13-2006 01:32 AM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On