Guidance
指路人
g.yi.org
Guidance Forums / Rapid-Q Basic / Problem

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Problem
#1006
Posted by: 2003-06-18 20:45:31
Sorry to keep posting this but I am getting quite desperate now I've spent hours on this with no joy. Here is the code as I feel it might help people know what I am on about. Basicaly on the fontdialogue box how do I get the program, to do somthing when bold, italic, strike through is selected etc?

As you might be able to tell I am making an HTML editor

code:

 SUB fontbox

  FontDialog.deloptions (fdNoStyleSel)

  fontcolour="black"
  FontDialog.GetFont(Font)
  IF FontDialog.EXECUTE THEN


   FontDialog.SetFont(Font)
   FontDialog.size=fontsize



   IF FontDialog.COLOR = 255 THEN fontcolour="Red"
   IF FontDialog.COLOR = 0 THEN fontcolour="Black"
   IF FontDialog.COLOR = 128 THEN fontcolour="Maroon"
   IF FontDialog.COLOR = 32768 THEN fontcolour="Green"
   IF FontDialog.COLOR = 32896 THEN fontcolour="Olive"
   IF FontDialog.COLOR = 8388608 THEN fontcolour="Navy"
   IF FontDialog.COLOR = 8388736 THEN fontcolour="Purple"
   IF FontDialog.COLOR = 8421376 THEN fontcolour="Teal"
   IF FontDialog.COLOR = 8421504 THEN fontcolour="Grey"
   IF FontDialog.COLOR = 12632256 THEN fontcolour="Silver"
   IF FontDialog.COLOR = 65280 THEN fontcolour="Lime"
   IF FontDialog.COLOR = -2147483640 THEN fontcolour="Black"
   IF FontDialog.COLOR = 65535 THEN fontcolour="Yellow"
   IF FontDialog.COLOR = 116711680 THEN fontcolour="Blue"
   IF FontDialog.COLOR = 16711935 THEN fontcolour="Fuchsia"
   IF FontDialog.COLOR = 16777215 THEN fontcolour="White"
   IF FontDialog.COLOR = 16776960 THEN fontcolour="Aqua"
   descriptioninput.AddString "<font color="+SM$+fontcolour+SM$+"face="+SM$+FontDialog.Name+SM$+" size"+SM$+fontsize+SM$+">"
'<font color="#1E48F0" face="Arial, Helvetica, sans-serif">
   IF fontdialog.AddStyles (fsBold) = true THEN PRINT "bold"
   fontdialog.DelOptions "fsbold"
  END IF

  FontDialog.size=fontsize

 END SUB
Message2. Re: Problem
#1007
Posted by: guidance 2003-06-19 08:49:15
QFont has no these properties from its document. I'm afraid you have to do it by win32api in stead of qfontdialog.
Message3. Re: Problem
#1008
Posted by: 2003-06-19 17:41:29
I don't need to use qfont though, as I am not changing the font on screen, I just want to add a string to a richedit object when the user selects bold, italic etc. If I still can't do it I guess I will will just have to make my own font box.
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Fri 2024-3-29  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0