| SuperStrict Local MyWindow:TGadget=CreateWindow("TextArea Example", 40,40,400,400) Global MyText:TGadget=CreateTextArea(0,0,380,360,MyWindow) Repeat WaitEvent() Select EventID() Case EVENT_WINDOWCLOSE End End Select Forever End |
![]() |
| SuperStrict Local MyWindow:TGadget=CreateWindow("TextArea Example", 40,40,400,400) Global MyText:TGadget=CreateTextArea(0,0,380,360,MyWindow) AddTextAreaText(MyText,"The Quick Brown Fox ") AddTextAreaText(MyText,"Jumps Over The Lazy Dog.") Repeat WaitEvent() Select EventID() Case EVENT_WINDOWCLOSE End End Select Forever End |
![]() |
| Function CreateTextArea:TGadget(x,y,w,h,group:TGadget,style=0) |
| Function SetTextAreaText( textarea:TGadget,text$,pos=0,length=TEXTAREA_ALL,units=TEXTAREA_CHARS ) |
| SuperStrict Local MyWindow:TGadget=CreateWindow("TextArea Example", 40,40,400,400) Global MyText:TGadget=CreateTextArea(0,0,380,360,MyWindow) AddTextAreaText(MyText,"The Quick Brown Fox ") AddTextAreaText(MyText,"Jumps Over The Lazy Dog.") SetTextAreaText(MyText,"Slow",4,5) Repeat WaitEvent() Select EventID() Case EVENT_WINDOWCLOSE End End Select Forever End |
![]() |
| SuperStrict Local MyWindow:TGadget=CreateWindow("TextArea Example", 40,40,400,400) Global MyText:TGadget=CreateTextArea(0,0,380,360,MyWindow) Local In:Tstream=ReadStream(Blitzmaxpath()+"/samples/spintext/spintext.bmx") While Not Eof(In) Local text:String=ReadLine(In) AddTextAreaText(MyText,Text+"~n") Wend CloseStream(In) Repeat WaitEvent() Select EventID() Case EVENT_WINDOWCLOSE End End Select Forever End |
![]() |
| SuperStrict Local MyWindow:TGadget=CreateWindow("TextArea Example", 40,40,400,400) Global MyText:TGadget=CreateTextArea(0,0,380,360,MyWindow) Local GUIFont:TGuiFont=LoadGuiFont( "Courier New",12) SetTextAreaFont(MyText,GUIFont) Local In:Tstream=ReadStream(Blitzmaxpath()+"/samples/spintext/spintext.bmx") While Not Eof(In) Local text:String=ReadLine(In) AddTextAreaText(MyText,Text+"~n") Wend CloseStream(In) Repeat WaitEvent() Select EventID() Case EVENT_WINDOWCLOSE End End Select Forever End |
![]() |
| SuperStrict Local MyWindow:TGadget=CreateWindow("TextArea Example", 40,40,400,400) Global MyText:TGadget=CreateTextArea(0,0,380,360,MyWindow) Local GUIFont:TGuiFont=LoadGuiFont( "Courier New",12) SetTextAreaFont(MyText,GUIFont) Local In:Tstream=ReadStream(Blitzmaxpath()+"/samples/spintext/spintext.bmx") While Not Eof(In) Local text:String=ReadLine(In) AddTextAreaText(MyText,Text+"~n") Wend CloseStream(In) SetTextAreaColor(MyText,1,81,107,True) SetTextAreaColor(MyText,255,255,50,False) Repeat WaitEvent() Select EventID() Case EVENT_WINDOWCLOSE End End Select Forever End |
| Function SetTextAreaColor( textarea:TGadget,r,g,b,bg=False ) |
![]() |
| Function TextAreaLen( textarea:TGadget,units=TEXTAREA_CHARS ) |
| SuperStrict Local MyWindow:TGadget=CreateWindow("TextArea Example", 40,40,400,400) Global MyText:TGadget=CreateTextArea(0,0,380,360,MyWindow) Local GUIFont:TGuiFont=LoadGuiFont( "Courier New",12) SetTextAreaFont(MyText,GUIFont) Local In:Tstream=ReadStream(Blitzmaxpath()+"/samples/spintext/spintext.bmx") While Not Eof(In) Local text:String=ReadLine(In) AddTextAreaText(MyText,Text+"~n") Wend CloseStream(In) SetTextAreaColor(MyText,1,81,107,True) SetTextAreaColor(MyText,255,255,50,False) Repeat WaitEvent() Select EventID() Case EVENT_WINDOWCLOSE End End Select Local char:Int=TextAreaLen(MyText,TEXTAREA_CHARS) Local lines:Int=TextAreaLen(MyText,TEXTAREA_LINES) SetStatusText MyWindow,"# of Characters="+char+" # Of Lines ="+Lines Forever End |
![]() |
| Function TextAreaText$( textarea:TGadget,pos=0,length=TEXTAREA_ALL,units=TEXTAREA_CHARS ) |
| SuperStrict Local MyWindow:TGadget=CreateWindow("TextArea Example", 40,40,400,400) Global MyText:TGadget=CreateTextArea(0,0,380,360,MyWindow) AddTextAreaText(MyText,"The Quick Brown Fox ") AddTextAreaText(MyText,"Jumps Over The Lazy Dog.") Local cursorpos:Int Repeat WaitEvent() Select EventID() Case EVENT_WINDOWCLOSE End Case EVENT_GADGETSELECT cursorpos=TextAreaCursor(MyText) End Select SetStatusText MyWindow, "Text ="+TextAreaText(MyText,0,cursorpos) Forever End |
![]() |
| Case EVENT_GADGETSELECT cursorpos=TextAreaCursor(MyText) |
| SuperStrict Local MyWindow:TGadget=CreateWindow("TextArea Example", 40,40,400,400) Global MyText:TGadget=CreateTextArea(0,0,380,360,MyWindow) AddTextAreaText(MyText,"The Quick Brown Fox ") AddTextAreaText(MyText,"Jumps Over The Lazy Dog.") Local cursorpos:Int Local SelectedLength:Int Repeat WaitEvent() Select EventID() Case EVENT_WINDOWCLOSE End Case EVENT_GADGETSELECT cursorpos=TextAreaCursor(MyText) SelectedLength=TextAreaSelLen(MyText) End Select SetStatusText MyWindow, "Text ="+TextAreaText(MyText,cursorpos,SelectedLength) Forever End |
![]() |
![]() |
| Function FormatTextAreaText( textarea:TGadget,r,g,b,flags,pos=0,length=TEXTAREA_ALL,units=TEXTAREA_CHARS |
| SuperStrict Local MyWindow:TGadget=CreateWindow("TextArea Example", 40,40,400,400) Global MyText:TGadget=CreateTextArea(0,0,380,360,MyWindow) Local GUIFont:TGuiFont=LoadGuiFont( "Courier New",12) SetTextAreaFont(MyText,GUIFont) Local In:Tstream=ReadStream(Blitzmaxpath()+"/samples/spintext/spintext.bmx") While Not Eof(In) Local text:String=ReadLine(In) AddTextAreaText(MyText,Text+"~n") Wend CloseStream(In) SetTextAreaColor(MyText,1,81,107,True) SetTextAreaColor(MyText,255,255,50,False) Local cursorpos:Int Local SelectedLength:Int Local MyWord:String Local Keyword:String="SetColor |DrawText |" Repeat WaitEvent() Select EventID() Case EVENT_WINDOWCLOSE End Case EVENT_GADGETSELECT cursorpos=TextAreaCursor(MyText) SelectedLength=TextAreaSelLen(MyText) MyWord=TextAreaText(MyText,cursorpos,SelectedLength) If Instr(KeyWord,MyWord+"|") Then .. FormatTextAreaText(MyText,0,255,0,0,Cursorpos,SelectedLength) End Select SetStatusText MyWindow,"Cursor is at Word:"+MyWord Forever End |
![]() |