Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 5 of 5
  1. #1
    Join Date
    May 2007
    Location
    New Jersey
    Posts
    144

    Font Dialog Problem

    Hello, I have a problem!
    I got this script and dll from a project I found on a forum:
    http://www.indigorose.com/forums/sho...87&postcount=2
    and I played with the script so it would make my input's properties what the user picks in the dialog cause in the example project it only writes what they picked in a paragraph object... This is what I got after a while:
    Code:
    	function GetFont()
    		sFontInfo = DLL.CallFunction("AutoPlay\\Docs\\ChoosFont.dll", "FontDialog", Application.GetWndHandle(), DLL_RETURN_TYPE_STRING, DLL_CALL_STDCALL)
    		FontName=DLL.CallFunction("AutoPlay\\Docs\\ChoosFont.dll", "GetField","\""..sFontInfo.."\",\";\","..1, DLL_RETURN_TYPE_STRING, DLL_CALL_STDCALL)
    		FontSize=String.ToNumber(DLL.CallFunction("AutoPlay\\Docs\\ChoosFont.dll", "GetField","\""..sFontInfo.."\",\";\","..2, DLL_RETURN_TYPE_STRING, DLL_CALL_STDCALL))
    		InputStyle=DLL.CallFunction("AutoPlay\\Docs\\ChoosFont.dll", "GetField","\""..sFontInfo.."\",\";\","..3, DLL_RETURN_TYPE_STRING, DLL_CALL_STDCALL)
    		FontColor=String.ToNumber(DLL.CallFunction("AutoPlay\\Docs\\ChoosFont.dll", "GetField","\""..sFontInfo.."\",\";\","..4, DLL_RETURN_TYPE_STRING, DLL_CALL_STDCALL))
    		FontWeight = FW_NORMAL
    		FontItalic = false
    		FontUnderline = false
    		FontStrikeout = false
    		
    		if String.Length(InputStyle) > 0 then
    			if String.Find(InputStyle,"B",1) > -1 then
    				FontWeight = FW_BOLD
    			end
    			if String.Find(InputStyle,"I",1) > -1 then
    				FontItalic = true
    			end
    			if String.Find(InputStyle,"U",1) > -1 then
    				FontUnderline = true
    			end
    			if String.Find(InputStyle,"S",1) > -1 then
    				FontStrikeout = true
    			end
    		end
    	
    		return {FontName,FontSize,FontWeight,FontItalic,FontUnderline,FontStrikeout,FontColor}
    	end
    	tblFontInfo = GetFont();
    	Input.SetProperties("Input1", tblFontInfo);
    And it doesn't work... Help... I want to use the dll in that forum to let the user pick the font properties and then apply the properties to a input object... Something like the one in the following forum:
    http://www.indigorose.com/forums/sho...Dialog+plug-in
    but i'm not using that because it does some problems in vista... When I close the window it says program stopped responding and stuff... THANKS

  2. #2
    Join Date
    May 2007
    Location
    New Jersey
    Posts
    144
    can anyone please help me???

  3. #3
    Join Date
    May 2006
    Posts
    5,380
    Here, try it like this

    Code:
    	function GetFont()
    		tblRetFontInfo={}
    		sFontInfo = DLL.CallFunction("AutoPlay\\Docs\\ChoosFont.dll", "FontDialog", Application.GetWndHandle(), DLL_RETURN_TYPE_STRING, DLL_CALL_STDCALL)
    		tblRetFontInfo.FontName=DLL.CallFunction("AutoPlay\\Docs\\ChoosFont.dll", "GetField","\""..sFontInfo.."\",\";\","..1, DLL_RETURN_TYPE_STRING, DLL_CALL_STDCALL)
    		tblRetFontInfo.FontSize=String.ToNumber(DLL.CallFunction("AutoPlay\\Docs\\ChoosFont.dll", "GetField","\""..sFontInfo.."\",\";\","..2, DLL_RETURN_TYPE_STRING, DLL_CALL_STDCALL))
    		InputStyle=DLL.CallFunction("AutoPlay\\Docs\\ChoosFont.dll", "GetField","\""..sFontInfo.."\",\";\","..3, DLL_RETURN_TYPE_STRING, DLL_CALL_STDCALL)
    		tblRetFontInfo.FontColor=String.ToNumber(DLL.CallFunction("AutoPlay\\Docs\\ChoosFont.dll", "GetField","\""..sFontInfo.."\",\";\","..4, DLL_RETURN_TYPE_STRING, DLL_CALL_STDCALL))
    		tblRetFontInfo.FontWeight = FW_NORMAL
    		tblRetFontInfo.FontItalic = false
    		tblRetFontInfo.FontUnderline = false
    		tblRetFontInfo.FontStrikeout = false
    		
    		if String.Length(InputStyle) > 0 then
    			if String.Find(InputStyle,"B",1) > -1 then
    				tblRetFontInfo.FontWeight = FW_BOLD
    			end
    			if String.Find(InputStyle,"I",1) > -1 then
    				tblRetFontInfo.FontItalic = true
    			end
    			if String.Find(InputStyle,"U",1) > -1 then
    				tblRetFontInfo.FontUnderline = true
    			end
    			if String.Find(InputStyle,"S",1) > -1 then
    				tblRetFontInfo.FontStrikeout = true
    			end
    		end
    		return tblRetFontInfo
    	end
    	
    	tblFontInfo = GetFont();
    	Input.SetProperties("Input1", tblFontInfo);
    instead of returning the elements, build a table and return that
    Open your eyes to Narcissism, Don't let her destroy your life!!

  4. #4
    Join Date
    May 2007
    Location
    New Jersey
    Posts
    144
    Thank you so much! I hardly understood what I was doing.. I was playing with it until I got something that looked like it should work... lol

  5. #5
    Join Date
    May 2006
    Posts
    5,380
    well i think thats how most of us learned, this forum is a wealth of information
    Open your eyes to Narcissism, Don't let her destroy your life!!

Similar Threads

  1. FREE PLUGIN: Font Dialog
    By Worm in forum AutoPlay Media Studio 7.5 Examples
    Replies: 18
    Last Post: 02-01-2009, 06:14 AM
  2. Custom Dialog Problem - Please !
    By shervin in forum AutoPlay Media Studio 6.0
    Replies: 1
    Last Post: 07-26-2007, 06:36 AM
  3. Problem whith Dialog Splash Flash
    By claudiana in forum AutoPlay Media Studio 6.0
    Replies: 3
    Last Post: 08-02-2006, 06:23 PM
  4. string problem with dialog messages
    By roadrunner in forum AutoPlay Media Studio 6.0
    Replies: 4
    Last Post: 02-20-2006, 02:29 PM
  5. SF6.0.1.2: Problem with installing TTF font
    By PitM in forum Setup Factory 6.0
    Replies: 3
    Last Post: 03-12-2003, 09:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts