How to insert a statusbar?
-
- User
- Posts: 59
- Joined: Sun Jul 21, 2013 8:30 am
How to insert a statusbar?
Hi,
I'm confused about how to insert a Status Bar, into an existing form.
If you open up your main form, then double-click on the StatusBar object, under Menus & Toolbars, nothing happens.
If, after double-clicking on the statusbar object, you switch the Form to Code View, there's no change.
If you directly insert some of the Help file sample StatusBar code, into the Form Code, right after Open Window, it eventually disappears. For a short time, I saw the Status Bar, in the Design View, but when I compiled and ran the app, there was no StatusBar, real-time.
So, how do we insert a Status Bar, into our application? Is there a way to insert one, while in the Designer? If not, where do we place the CreateStatusBar and StatusBarText code?
I'm confused about how to insert a Status Bar, into an existing form.
If you open up your main form, then double-click on the StatusBar object, under Menus & Toolbars, nothing happens.
If, after double-clicking on the statusbar object, you switch the Form to Code View, there's no change.
If you directly insert some of the Help file sample StatusBar code, into the Form Code, right after Open Window, it eventually disappears. For a short time, I saw the Status Bar, in the Design View, but when I compiled and ran the app, there was no StatusBar, real-time.
So, how do we insert a Status Bar, into our application? Is there a way to insert one, while in the Designer? If not, where do we place the CreateStatusBar and StatusBarText code?
-
- User
- Posts: 59
- Joined: Sun Jul 21, 2013 8:30 am
Re: How to insert a statusbar?
Btw, dragging and dropping doesn't work, either.PBExplorer12 wrote:Hi,
I'm confused about how to insert a Status Bar, into an existing form.
If you open up your main form, then double-click on the StatusBar object, under Menus & Toolbars, nothing happens.
If, after double-clicking on the statusbar object, you switch the Form to Code View, there's no change.
If you directly insert some of the Help file sample StatusBar code, into the Form Code, right after Open Window, it eventually disappears. For a short time, I saw the Status Bar, in the Design View, but when I compiled and ran the app, there was no StatusBar, real-time.
So, how do we insert a Status Bar, into our application? Is there a way to insert one, while in the Designer? If not, where do we place the CreateStatusBar and StatusBarText code?
Re: How to insert a statusbar?
Hello PBExplorer12. For some reason, menus and toolbars cannot be dragged & dropped onto the form. To instantiate them, they'd have to be double-clicked, or clicked once then dragged & drawn on the form. To repeat, this only instantiates the gadget, but does not create them yet. Items and objects must be added to them by clicking on the icon that appears on them (a small document icon with a green plus sign). Once added, the relevant code for these gadgets will be generated, and they will appear at runtime.PBExplorer12 wrote:...how do we insert a Status Bar, into our application? Is there a way to insert one, while in the Designer?
Further to this, besides the layout code that appears in the OpenWIndow_X procedure, Form Designer does not allow any other code to be added manually. Such additions will be wiped out, as you have seen. Add these three status bar commands to the OpenWIndow_X procedure, and it will also be created accordingly:
Code: Select all
Procedure OpenWindow_0...
Window_0 = OpenWindow...
CreateStatusBar(0, WindowID(Window_0))
AddStatusBarField(100)
StatusBarText(0, 0, "MyStatusBar")

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?
Doesn't work at all. Whether I double-click or single-click and drag, the status bar doesn't show up anywhere on the forum. So I can't add items visually.TI-994A wrote:Hello PBExplorer12. For some reason, menus and toolbars cannot be dragged & dropped onto the form. To instantiate them, they'd have to be double-clicked, or clicked once then dragged & drawn on the form. To repeat, this only instantiates the gadget, but does not create them yet. Items and objects must be added to them by clicking on the icon that appears on them (a small document icon with a green plus sign). Once added, the relevant code for these gadgets will be generated, and they will appear at runtime.PBExplorer12 wrote:...how do we insert a Status Bar, into our application? Is there a way to insert one, while in the Designer?
Further to this, besides the layout code that appears in the OpenWIndow_X procedure, Form Designer does not allow any other code to be added manually. Such additions will be wiped out, as you have seen. Add these three status bar commands to the OpenWIndow_X procedure, and it will also be created accordingly:Hope it works out.Code: Select all
Procedure OpenWindow_0... Window_0 = OpenWindow... CreateStatusBar(0, WindowID(Window_0)) AddStatusBarField(100) StatusBarText(0, 0, "MyStatusBar")
I just tried inserting your CreateStatusBar code, into the OpenWindow proc (called OpenfrmFirstForm, in my code). I had done this previously, and it displayed in the Designer, but eventually disappeared.
However, the status bar seems to be persistent now, the Creation code seems to be remaining in the OpenfrmFirstForm proc. So, we'll see what happens, thanks.
-
- User
- Posts: 59
- Joined: Sun Jul 21, 2013 8:30 am
Re: How to insert a statusbar?
PBExplorer12 wrote:Doesn't work at all. Whether I double-click or single-click and drag, the status bar doesn't show up anywhere on the forum. So I can't add items visually.TI-994A wrote:Hello PBExplorer12. For some reason, menus and toolbars cannot be dragged & dropped onto the form. To instantiate them, they'd have to be double-clicked, or clicked once then dragged & drawn on the form. To repeat, this only instantiates the gadget, but does not create them yet. Items and objects must be added to them by clicking on the icon that appears on them (a small document icon with a green plus sign). Once added, the relevant code for these gadgets will be generated, and they will appear at runtime.PBExplorer12 wrote:...how do we insert a Status Bar, into our application? Is there a way to insert one, while in the Designer?
Further to this, besides the layout code that appears in the OpenWIndow_X procedure, Form Designer does not allow any other code to be added manually. Such additions will be wiped out, as you have seen. Add these three status bar commands to the OpenWIndow_X procedure, and it will also be created accordingly:Hope it works out.Code: Select all
Procedure OpenWindow_0... Window_0 = OpenWindow... CreateStatusBar(0, WindowID(Window_0)) AddStatusBarField(100) StatusBarText(0, 0, "MyStatusBar")
I just tried inserting your CreateStatusBar code, into the OpenWindow proc (called OpenfrmFirstForm, in my code). I had done this previously, and it displayed in the Designer, but eventually disappeared.
However, the status bar seems to be persistent now, the Creation code seems to be remaining in the OpenfrmFirstForm proc. So, we'll see what happens, thanks.
Looks good, working as expected.
Re: How to insert a statusbar?
Hi PBExplorer12. What version of PureBasic are you using? Adding menus and toolbars by double-clicking is only possible in PureBasic 5.20.PBExplorer12 wrote:Doesn't work at all. Whether I double-click or single-click and drag, the status bar doesn't show up anywhere on the forum. So I can't add items visually.
If you are using an earlier version, you can still draw (not drag & drop) them onto the form:
1. Click once on the Menu, ToolBar, or StatusBar object in the toolbox (click and let go).
2. Move the mouse cursor over to the form (don't press any mouse button, just move).
3. Now, anywhere on the form, press and hold the left mouse button, move the mouse a little, then release the button.
4. The Menu, ToolBar, or StatusBar should now be drawn onto the form.
5. Click on the small document icon with the green plus sign and add the required items.
That's all.

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. What version of PureBasic are you using? Adding menus and toolbars by double-clicking is only possible in PureBasic 5.20.PBExplorer12 wrote:Doesn't work at all. Whether I double-click or single-click and drag, the status bar doesn't show up anywhere on the forum. So I can't add items visually.
If you are using an earlier version, you can still draw (not drag & drop) them onto the form:
1. Click once on the Menu, ToolBar, or StatusBar object in the toolbox (click and let go).
2. Move the mouse cursor over to the form (don't press any mouse button, just move).
3. Now, anywhere on the form, press and hold the left mouse button, move the mouse a little, then release the button.
4. The Menu, ToolBar, or StatusBar should now be drawn onto the form.
5. Click on the small document icon with the green plus sign and add the required items.
That's all.
You're right. I have 5.11. I purchased it fairly recently, and didn't realize there was an upgrade.
Ok, thanks.
-
- User
- Posts: 59
- Joined: Sun Jul 21, 2013 8:30 am
Re: How to insert a statusbar?
PBExplorer12 wrote:TI-994A wrote:Hi PBExplorer12. What version of PureBasic are you using? Adding menus and toolbars by double-clicking is only possible in PureBasic 5.20.PBExplorer12 wrote:Doesn't work at all. Whether I double-click or single-click and drag, the status bar doesn't show up anywhere on the forum. So I can't add items visually.
If you are using an earlier version, you can still draw (not drag & drop) them onto the form:
1. Click once on the Menu, ToolBar, or StatusBar object in the toolbox (click and let go).
2. Move the mouse cursor over to the form (don't press any mouse button, just move).
3. Now, anywhere on the form, press and hold the left mouse button, move the mouse a little, then release the button.
4. The Menu, ToolBar, or StatusBar should now be drawn onto the form.
5. Click on the small document icon with the green plus sign and add the required items.
That's all.
You're right. I have 5.11. I purchased it fairly recently, and didn't realize there was an upgrade.
Ok, thanks.
Confused. When I go to the download area, the most recent version that's being offered is 5.11.
I'll contact Support, find out what's happening, thanks.
Re: How to insert a statusbar?
This feature will be available in 5.20 (or you can download the beta version of 5.20)
-
- User
- Posts: 59
- Joined: Sun Jul 21, 2013 8:30 am
Re: How to insert a statusbar?
Polo wrote:This feature will be available in 5.20 (or you can download the beta version of 5.20)
Ah, ok. Understood. I'll hold off, for now, everything's working fine.
I have to try to resolve the problem of static fields on the Status bar, to programmatically make them 'stretch' in some way, when needed.
For example, if the current directory is just 'c:\Projects', then a small number of characters are fine. But if it's something like 'c:\program Files (x86)\AnvSoft\Any DVD Converter Professional\data\Sample', it would be cool to have it automatically stretch. (up to a maximum number of characters; longer than that, and scrolling is enabled).
If you have any suggestions, please let me know. Planning to just write some code to perform this.
Re: How to insert a statusbar?
Hello PBExplorer12. The steps outlined above work on the Form Designer in PureBasic 5.11 as well.PBExplorer12 wrote:You're right. I have 5.11. I purchased it fairly recently, and didn't realize there was an upgrade.TI-994A wrote:Hi PBExplorer12. What version of PureBasic are you using? Adding menus and toolbars by double-clicking is only possible in PureBasic 5.20.PBExplorer12 wrote:Doesn't work at all. Whether I double-click or single-click and drag, the status bar doesn't show up anywhere on the forum. So I can't add items visually.
If you are using an earlier version, you can still draw (not drag & drop) them onto the form:
1. Click once on the Menu, ToolBar, or StatusBar object in the toolbox (click and let go).
2. Move the mouse cursor over to the form (don't press any mouse button, just move).
3. Now, anywhere on the form, press and hold the left mouse button, move the mouse a little, then release the button.
4. The Menu, ToolBar, or StatusBar should now be drawn onto the form.
5. Click on the small document icon with the green plus sign and add the required items.
That's all.
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?
Ok. I don't know what I did wrong previously, but the statusbar is on the form now, and has been there all day. All set, problelm solved, thanks TI.TI-994A wrote:Hello PBExplorer12. The steps outlined above work on the Form Designer in PureBasic 5.11 as well.PBExplorer12 wrote:You're right. I have 5.11. I purchased it fairly recently, and didn't realize there was an upgrade.TI-994A wrote:Hi PBExplorer12. What version of PureBasic are you using? Adding menus and toolbars by double-clicking is only possible in PureBasic 5.20.PBExplorer12 wrote:Doesn't work at all. Whether I double-click or single-click and drag, the status bar doesn't show up anywhere on the forum. So I can't add items visually.
If you are using an earlier version, you can still draw (not drag & drop) them onto the form:
1. Click once on the Menu, ToolBar, or StatusBar object in the toolbox (click and let go).
2. Move the mouse cursor over to the form (don't press any mouse button, just move).
3. Now, anywhere on the form, press and hold the left mouse button, move the mouse a little, then release the button.
4. The Menu, ToolBar, or StatusBar should now be drawn onto the form.
5. Click on the small document icon with the green plus sign and add the required items.
That's all.
Re: How to insert a statusbar?
Great! To auto-size the status bar field, simply create it with AddStatusBarField(#PB_Ignore).PBExplorer12 wrote:I have to try to resolve the problem of static fields on the Status bar, to programmatically make them 'stretch' in some way, when needed.
For example, if the current directory is just 'c:\Projects', then a small number of characters are fine. But if it's something like 'c:\program Files (x86)\AnvSoft\Any DVD Converter Professional\data\Sample', it would be cool to have it automatically stretch. (up to a maximum number of characters; longer than that, and scrolling is enabled).
Not too sure about scrolling the text though.

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 

Re: How to insert a statusbar?
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).
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
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:Great! To auto-size the status bar field, simply create it with AddStatusBarField(#PB_Ignore).PBExplorer12 wrote:I have to try to resolve the problem of static fields on the Status bar, to programmatically make them 'stretch' in some way, when needed.
For example, if the current directory is just 'c:\Projects', then a small number of characters are fine. But if it's something like 'c:\program Files (x86)\AnvSoft\Any DVD Converter Professional\data\Sample', it would be cool to have it automatically stretch. (up to a maximum number of characters; longer than that, and scrolling is enabled).
Not too sure about scrolling the text though.
Perfect, thanks.