LB Booster
« Split pane demo »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 03:56am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Split pane demo  (Read 556 times)
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Split pane demo
« Thread started on: Nov 29th, 2016, 2:52pm »

One of the features of LBB is that the WHEN mouse events work in a window of type WINDOW as well as a window of type GRAPHICS. This allows you to do some things that would not be as straightforward in LB 4.5.

Here's a very simple demo of a window which is split into two texteditor controls (they could just as well be any other kind of control). You can move the split point by dragging it horizontally with the mouse. It uses an embedded BBC BASIC statement to switch the cursor to a double-pointed-arrow, something which isn't so easy in LB (would anybody like me to add some more cursor types to LBB?).

Code:
    WindowWidth = 600
    texteditor #w.te1, 0, 0, 290, 300
    texteditor #w.te2, 294, 0, 290, 300
    open "Pane test" for window as #w
    #w "when leftButtonMove resize"
    !MOUSE ON 132
    wait
    
sub resize h$, x, y
    #w.te1 "!locate 0 0 ";x-2;" 300"
    #w.te2 "!locate ";x+2;" 0 ";WindowWidth-x-18;" 300"
    #w "refresh"
end sub 

Richard.
User IP Logged

RNBW
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 106
xx Re: Split pane demo
« Reply #1 on: Nov 29th, 2016, 4:35pm »

Richard

Nice bit of useful code!

You can still move the seperator without !MOUSE ON 132, but it's much more like you normally get with Windows with the double headed arrow hovering above the seperator.

It could be useful to know more !MOUSE cursor types.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Split pane demo
« Reply #2 on: Nov 29th, 2016, 4:44pm »

on Nov 29th, 2016, 4:35pm, RNBW wrote:
It could be useful to know more !MOUSE cursor types.

If you use !MOUSE ON you can of course look up the choices in the BBC BASIC documentation. What I was suggesting is that I could extend the native LBB CURSOR statement to support a wider range of pointer types.

I'm thinking that the simplest option would be to use exactly the same approach as LB adopts with the RULE command: i.e. allowing you to use either preset names or Windows constants. This would allow you to do:

Code:
    CURSOR _IDC_SIZEWE 

Richard.
User IP Logged

RNBW
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 106
xx Re: Split pane demo
« Reply #3 on: Nov 29th, 2016, 6:47pm »

Richard

Thank you, I've looked up in the BBC documentation and the MOUSE types and number references are all clearly identified (as expected).

I very rarely use LB these days. I only use it if there is a need to check out something in LB. I more often than not use LBB. The reason being that it does things properly rather than some of the weird ways of LB. So, I think I'll just stick to the !MOUSE format.

I recently converted a program I had written in QB64 into LB/LBB. I was surprised how easy it was. All I had to change was Labels (label: to [label]) and Using (using "##.##"; var to using ("##.##",var).

I know the program was simple, but the effort was worth it. I didn't get LB to write console programs, but it does show how the MainWin can be used for other purposes than debugging.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls