Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Large font textconterol
02-20-2018, 04:23 AM
Post: #1
Large font textconterol
A textcontrol cannot set the text font, but a textedit can.

this example shows how to use a one-line textedit as a textcontrol and use a large font.

Code:
#!yab

doc Place a description of your
doc program here.
doc
doc Author, date, license

// set DEBUG = 1 to print out all messages on the console
DEBUG = 0

OpenWindow()

// Main Message Loop
dim msg$(1)
while(not leavingLoop)
    ret = TEXTEDIT GET "test", "countlines"
    if ret>1 then
    a$=textedit get$ "test"
    print a$
    ret = 0
    TEXTEDIT CLEAR "test"
    endif
    
    nCommands = token(message$, msg$(), "|")

    for everyCommand = 1 to nCommands
        if(DEBUG and msg$(everyCommand)<>"") print msg$(everyCommand)

        switch(msg$(everyCommand))
            case "_QuitRequested"
            case "MainWindow:_QuitRequested"
                leavingLoop = true
                break
            default
            
        end switch
        

    next everyCommand

wend

CloseWindow()

end


// Setup the main window here
sub OpenWindow()
    window open 100,100 to 600,500, "MainWindow", "Main Window"
    textedit 10,10 to 300,50, "test", 0,"MainWindow"
    TEXTEDIT SET "test", "font", "DejaVu Sans,Condensed Bold,32"
    return
end sub

// Close down the main window
sub CloseWindow()
    window close "MainWindow"
    return
end sub

Fat Elk Sortware
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Free Web Hosting