Yes, the #PB_Ignore looks like it just distributes all the status bar fields, to an equal length. That's actually not a bad thing temporarily. But I'll follow along with your code, by creating an alternate StatusBarText procedure, which does the length-adjusting that you're describing above. StatusBarText() is used several times in the app, depending on any changing directories or sqlite database names, so this needs to be done outside of the OpenWindow vicinity, as well.TI-994A wrote:Hello again. Probably not the type of scrolling you're looking for, but it's a start:PBExplorer12 wrote:...it would be cool to have it automatically stretch. (up to a maximum number of characters; longer than that, and scrolling is enabled).In the form code, set the AddStatusBarField() to a small value, around 200; don't use #PB_Ignore.Code: Select all
IncludeFile "MyForm.pbf" Global statText.s = GetTemporaryDirectory() OpenWindow_0() AddWindowTimer(Window_0, 0, 200) Repeat Select WaitWindowEvent() Case #PB_Event_CloseWindow appQuit = 1 Case #PB_Event_Timer t + 1 StatusBarText(0, 0, Mid(statText, t)) If t = Len(statText) t = 0 EndIf EndSelect Until appQuit = 1
How to insert a statusbar?
-
- User
- Posts: 59
- Joined: Sun Jul 21, 2013 8:30 am
Re: How to insert a statusbar?
Re: How to insert a statusbar?
Hi PBExplorer12. That's not quite accurate. AddStatusBarField() would only auto-size the fields initialised with #PB_Ignore. Fields initialised with specific widths would not be proportioned.PBExplorer12 wrote:...#PB_Ignore looks like it just distributes all the status bar fields, to an equal length.
That example is not a length-adjusting routine, but rather one to scroll lengthy texts in a narrow status bar field, as you requested.PBExplorer12 wrote:...alternate StatusBarText procedure, which does the length-adjusting that you're describing above.
You're right, and if you look carefully, the status bar text was not assigned in the OpenWindow procedure.PBExplorer12 wrote:StatusBarText() is used several times in the app, depending on any changing directories or sqlite database names, so this needs to be done outside of the OpenWindow vicinity...
This is a fully standalone and ready-to-run example that does not utilise any external forms, which might illustrate these concepts a little better:
Code: Select all
;create a normal window
wFlags = #PB_Window_SystemMenu | #PB_Window_ScreenCentered
OpenWindow(0, #PB_Ignore, #PB_Ignore, 400, 100, "StatusBar Example", wFlags)
;add a button to initiate changes in the status bar captions
ButtonGadget(1, 100, 15, 200, 50, "Click to change the caption in the " +
"first field of the status bar...", #PB_Button_MultiLine)
;add a status bar to that window
CreateStatusBar(0, WindowID(0))
;add the first field to that status bar, 200 pixels wide
AddStatusBarField(200)
;add a caption to that field
StatusBarText(0, 0, "First Field")
;add the second field to the status bar, to be auto-sized
AddStatusBarField(#PB_Ignore)
;add a caption to the second field
StatusBarText(0, 1, "2nd field")
;add the third field to the status bar, also to be auto-sized
AddStatusBarField(#PB_Ignore)
;add a caption to the second field
StatusBarText(0, 2, "3rd field")
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
appQuit = 1
Case #PB_Event_Gadget
Select EventGadget()
;button clicked
Case 1
;if button clicked the second time
If toggle
;start a timer to scroll the first caption in the status bar
AddWindowTimer(0, 0, 200)
;hide the button as no longer required
HideGadget(1, 1)
;if button clicked the first time
Else
;change the caption of the first field of the status bar
;to display the system's temporary directory
StatusBarText(0, 0, GetTemporaryDirectory())
;change the caption of the button for secondary function
SetGadgetText(1, "Click to start scrolling the caption in " +
"the first field of the status bar...")
;set a variable flag to activate button's secondary function
toggle = 1
EndIf
EndSelect
Case #PB_Event_Timer
;caption scrolling routine
textStartPos + 1
StatusBarText(0, 0, Mid(GetTemporaryDirectory(), textStartPos))
If textStartPos = 1
Delay(1000)
EndIf
If textStartPos = Len(GetTemporaryDirectory())
textStartPos = 0
EndIf
EndSelect
Until appQuit = 1
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel
-
- User
- Posts: 59
- Joined: Sun Jul 21, 2013 8:30 am
Re: How to insert a statusbar?
TI-994A wrote:Hi PBExplorer12. That's not quite accurate. AddStatusBarField() would only auto-size the fields initialised with #PB_Ignore. Fields initialised with specific widths would not be proportioned.PBExplorer12 wrote:...#PB_Ignore looks like it just distributes all the status bar fields, to an equal length.
That example is not a length-adjusting routine, but rather one to scroll lengthy texts in a narrow status bar field, as you requested.PBExplorer12 wrote:...alternate StatusBarText procedure, which does the length-adjusting that you're describing above.
You're right, and if you look carefully, the status bar text was not assigned in the OpenWindow procedure.PBExplorer12 wrote:StatusBarText() is used several times in the app, depending on any changing directories or sqlite database names, so this needs to be done outside of the OpenWindow vicinity...
This is a fully standalone and ready-to-run example that does not utilise any external forms, which might illustrate these concepts a little better:Hope it helps to clarify things.Code: Select all
;create a normal window wFlags = #PB_Window_SystemMenu | #PB_Window_ScreenCentered OpenWindow(0, #PB_Ignore, #PB_Ignore, 400, 100, "StatusBar Example", wFlags) ;add a button to initiate changes in the status bar captions ButtonGadget(1, 100, 15, 200, 50, "Click to change the caption in the " + "first field of the status bar...", #PB_Button_MultiLine) ;add a status bar to that window CreateStatusBar(0, WindowID(0)) ;add the first field to that status bar, 200 pixels wide AddStatusBarField(200) ;add a caption to that field StatusBarText(0, 0, "First Field") ;add the second field to the status bar, to be auto-sized AddStatusBarField(#PB_Ignore) ;add a caption to the second field StatusBarText(0, 1, "2nd field") ;add the third field to the status bar, also to be auto-sized AddStatusBarField(#PB_Ignore) ;add a caption to the second field StatusBarText(0, 2, "3rd field") Repeat Select WaitWindowEvent() Case #PB_Event_CloseWindow appQuit = 1 Case #PB_Event_Gadget Select EventGadget() ;button clicked Case 1 ;if button clicked the second time If toggle ;start a timer to scroll the first caption in the status bar AddWindowTimer(0, 0, 200) ;hide the button as no longer required HideGadget(1, 1) ;if button clicked the first time Else ;change the caption of the first field of the status bar ;to display the system's temporary directory StatusBarText(0, 0, GetTemporaryDirectory()) ;change the caption of the button for secondary function SetGadgetText(1, "Click to start scrolling the caption in " + "the first field of the status bar...") ;set a variable flag to activate button's secondary function toggle = 1 EndIf EndSelect Case #PB_Event_Timer ;caption scrolling routine textStartPos + 1 StatusBarText(0, 0, Mid(GetTemporaryDirectory(), textStartPos)) If textStartPos = 1 Delay(1000) EndIf If textStartPos = Len(GetTemporaryDirectory()) textStartPos = 0 EndIf EndSelect Until appQuit = 1
Hi Ti,
I'm already set on this. Everything's working fine, but I'll take a look at your examples, see if the code can be improved upon.
>>Hi PBExplorer12. That's not quite accurate. AddStatusBarField() would only auto-size the fields initialised with #PB_Ignore. Fields initialised with specific widths would not be proportioned.<<
Yes, but for my purposes it does an equal distribution. In the Init() method, one of the early calls are
AddStatusBarField(#PB_Ignore)
AddStatusBarField(#PB_Ignore)
AddStatusBarField(#PB_Ignore)
AddStatusBarField(#PB_Ignore)
AddStatusBarField(#PB_Ignore)
StatusBarText( 0, #STATUSBARFIELD_CURRENTDIRECTORY, sCurrentDirectory )
StatusBarText( 0, #STATUSBARFIELD_DATABASE, "Db" )
StatusBarText( 0, #STATUSBARFIELD_TABLE, "Tbl" )
StatusBarText( 0, #STATUSBARFIELD_FILTER, "" )
StatusBarText( 0, #STATUSBARFIELD_LANGUAGE, "Language" )
, and those are the only status bar fields that are created. Any others, will be added to this section, as the app develops.
>>That example is not a length-adjusting routine, but rather one to scroll lengthy texts in a narrow status bar field, as you requested.<<
Ok, thanks TI.
Are there ways to do screen attachments, on a forum post? I can't seem to locate any Attach button.
Re: How to insert a statusbar?
You can include an image with by using:PBExplorer12 wrote:Are there ways to do screen attachments, on a forum post? I can't seem to locate any Attach button.
which means you will have to store it somewhere else and simply reference it in your message.
Re: How to insert a statusbar?
This forum IS Support ...PBExplorer12 wrote:I'll contact Support, find out what's happening, thanks.
-
- User
- Posts: 59
- Joined: Sun Jul 21, 2013 8:30 am
Re: How to insert a statusbar?
Ah, ok, I see it, thanks.Demivec wrote:You can include an image with by using:PBExplorer12 wrote:Are there ways to do screen attachments, on a forum post? I can't seem to locate any Attach button.
which means you will have to store it somewhere else and simply reference it in your message.
-
- User
- Posts: 59
- Joined: Sun Jul 21, 2013 8:30 am
Re: How to insert a statusbar?
USCode wrote:This forum IS Support ...PBExplorer12 wrote:I'll contact Support, find out what's happening, thanks.
Yes, it is. Prompt and generous support, at that.