|
Post by flotul on Apr 16, 2021 11:44:59 GMT -5
Hi there, For one of my small applications, I'm trying to make somekind of help screen where I describe things for the user. I first made it with a NOTICE. But here, I don't see how I can format text. So I change for an additional window to my program, window dedicated to display the help information. Unfortunately, I struggle to find a way to make the text look like: Title of first chapterText in the first chapter.Title of second chapterText in the second chapter.I thought using STATICTEXT and style bits would be okay but I can't find any info about text style bits. I then tried a TEXTBOX but this is not okay since I can't get it to not make the text "editable". Am I going completely wrong or is it so difficult to format text in a "text" type window? Thanks for any help
|
|
cundo
Full Member
Muchas Gracias!!
Posts: 146
|
Post by cundo on Apr 16, 2021 12:38:18 GMT -5
Many, many ways to do this,
WindowWidth = 640 : WindowHeight = 480 UpperLeftX=int((DisplayWidth-WindowWidth)/2) UpperLeftY=int((DisplayHeight-WindowHeight)/2)
statictext #main.st1 "",16,20,200,25
statictext #main.st2 "",16,50,200,25
statictext #main.st3 "",16,80,200,25
statictext #main.st4 "",16,110,200,25
Open "untiltled" for window as #main #main "trapclose [quit]"
#main.st1 "!font arial 10 italic bold" #main.st1 "Title of first chapter"
#main.st2 "!font arial 10 italic " #main.st2 "Text in the first chapter."
#main.st3 "!font arial 10 italic bold" #main.st3 "Title of second chapter"
#main.st4 "!font arial 10 italic " #main.st4 "Text in the second chapter."
wait
[quit] close #main end
|
|
cundo
Full Member
Muchas Gracias!!
Posts: 146
|
Post by cundo on Apr 16, 2021 12:43:02 GMT -5
With a graphic type Window.
WindowWidth = 640 : WindowHeight = 480 UpperLeftX=int((DisplayWidth-WindowWidth)/2) UpperLeftY=int((DisplayHeight-WindowHeight)/2)
Open "untiltled" for graphics_nsb as #main #main "trapclose [quit]; down" #main "|" ' empty hidden line
#main "font arial 10 italic bold;color blue" #main "|Title of first chapter"
#main "font arial 10 italic;color black " #main "|Text in the first chapter."
#main "|"
#main "font arial 10 italic bold;color red" #main "|Title of second chapter"
#main "font arial 10 italic; color black " #main "|Text in the second chapter."
#main "flush" wait
[quit] close #main end
|
|
|
Post by tsh73 on Apr 16, 2021 14:38:20 GMT -5
I think it clearly impossible.
You can "!disable" textbox, and it will be not editable any more (though not scrollable and selectable too) But it still will be "whole text looks the same", like TEXT type window (or Windows Notepad).
nomainwin WindowWidth = 320: WindowHeight = 305 texteditor #main.texteditor1, 26, 16, 272, 225
open "untitled" for window as #main print #main, "trapclose [quit.main]"
#main.texteditor1 "This is a textbox" _ +chr$(13)+"you cannot edit" _ +chr$(13)+"because I disabled it"
#main.texteditor1 "!disable" wait
[quit.main] Close #main END
Easiest way to show formatted text, IMHO, is make it in any word processor then save as HTML file. Now just ask Windows to show it. It will be separate window.
|
|
|
Post by flotul on Apr 16, 2021 15:45:36 GMT -5
Many, many ways to do this, WindowWidth = 640 : WindowHeight = 480......
Thanks a lot Cundo, Your code works and I did try the exact same code before. I just found out that, depending on the chosen font, nothing will work (no formatting will be visible). In my case, I was not setting any font; I was using the "standart" one and doing so, nothing seems to work. Thanks again
|
|