Coloring text in a realBASIC MsgBox

Discussion in 'Mac Programming' started by oliverhelm, Dec 27, 2005.

  1. macrumors newbie

    Joined:
    Dec 27, 2005
    #1
    Hi,
    Does any one know how i can colour some of the text in a realBASIC msgBox?
    Thanks
     
  2. macrumors 68030

    Les Kern

    Joined:
    Apr 26, 2002
    Location:
    Alabama
    #2
    What version of RB are you using?
     
  3. macrumors 68020

    bobber205

    Joined:
    Nov 15, 2005
    Location:
    Oregon
    #3
    I doubt it.

    I doubt you can.

    If you're really intent on coloring text, come up with your own message box that takes color as a paramater.

    I might make one if I have time today.
    (I have lots of free time).
     
  4. macrumors 6502

    Joined:
    Apr 7, 2005
    Location:
    Austria
    #4
    I create my own dialogues for most tasks, then you have complete control.
     
  5. macrumors 68030

    Les Kern

    Joined:
    Apr 26, 2002
    Location:
    Alabama
    #5
    You can always set your globals to handle things like that... here's some sample code I made for a text-base app...

    'Dim Header as String
    'Dim HDate as String
    'Dim TimeStamp, LogEntry as String
    'Dim h as new StyledText
    'Dim d as new date
    'Dim st as Integer
    '
    '
    '//Setup header initiale Attributes
    'Header = "Coachstat Journal"
    'HDate = d.LongDate
    'TimeStamp = d.shorttime + " Entry:"
    'LogEntry = " This is how your journal entries will look."
    '
    'h.Text = Header + EndOfLine + Hdate + EndOfLine + TimeStamp + EndOfLine + LogEntry + EndOfLine
    '
    '//Set Header Attributes
    'h.Bold(0,len(Header)) = True
    'h.Size(0,len(Header)) = 18
    'h.TextColor(0,len(Header)) = &cff0000
    'h.Underline(0,len(Header)) = True
    '
    '
    'st = len(Header) + 1
    '//Set Date Attributes
    'h.TextColor(st,len(HDate)) = &c000000
    'h.Size(st,len(HDate)) = 12
    'h.bold(st,len(HDate)) = false
    '
    'st = st + 1 + len(HDate)
    'h.TextColor(st,len(TimeStamp)) = &cFF00FF
    'h.Size(st,len(TimeStamp)) = 12
    '
    'st = st + 1 + len(LogEntry)
    'h.TextColor(st, 40) = &c000000
    '
    'h.Font(0,len(h.text)) = "Comic Sans MS"
    '
    'HeaderBox.StyledText = h
    '
    'HeaderBox.StyledText.ParagraphAlignment(0)=Paragraph.AlignCenter
    'HeaderBox.StyledText.ParagraphAlignment(1)=Paragraph.AlignCenter
    'HeaderBox.StyledText.ParagraphAlignment(2)=Paragraph.AlignLeft
    '

    Of course you may just need to set one field to have those attributes, so just use "me" and set up a styled text attribute, then equal the call for that attribute to the built in RB colors... like "=&cFFFFFF".
     
  6. thread starter macrumors newbie

    Joined:
    Dec 27, 2005
    #6
    Im using version 5.5.5...
    I know it can be done, and simply, cos i have seen it done by a friend in one of there programs, using a standard msg box!
    He however is away for a month or two!
     

Share This Page