BBC BASIC for Windows
« The future of BBC BASIC for Windows »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 11:34pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1 2  Notify Send Topic Print
 hotthread  Author  Topic: The future of BBC BASIC for Windows  (Read 252 times)
admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: The future of BBC BASIC for Windows
« Reply #11 on: Mar 9th, 2012, 1:38pm »

So, from the general lack of response, I suppose I must conclude that hardly anybody else shares my concern that BBC BASIC is significantly inferior to Liberty BASIC in some important respects. This is disappointing, but not altogether unexpected.

On that basis I have to assume there is little enthusiasm for a new GUILIB library. It is my opinion that without such a library BBC BASIC should not be promoted as a 'Windows' programming language, since it does not adequately support the GUI paradigm that is the essence of Windows.

Richard.

User IP Logged

Michael Hutton
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 248
xx Re: The future of BBC BASIC for Windows
« Reply #12 on: Mar 9th, 2012, 5:28pm »

on Mar 9th, 2012, 1:38pm, Richard Russell wrote:
.... shares my concern that BBC BASIC is significantly inferior to Liberty BASIC in some important respects.


I am sorry, I am just not able to comment not being a LB user.

I am willing to help get a GUILIB up and running. But with this I would not be able to compare it to LB at all.

I don't know who else in the world of BB4W also uses LB except for Gordon and you, and the few posters in the yahoo groups.

Michael
« Last Edit: Mar 9th, 2012, 5:28pm by Michael Hutton » User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: The future of BBC BASIC for Windows
« Reply #13 on: Mar 9th, 2012, 10:01pm »

on Mar 9th, 2012, 5:28pm, Michael Hutton wrote:
I am sorry, I am just not able to comment not being a LB user.

Although one could use the LB GUI model as a template for the sort of features a new GUILIB should provide, an equally valid template might be the Visual Basic model, or any other GUI framework. I would welcome suggestions from all sources.

What is clear is that the existing WINLIBx libraries aren't satisfactory. They were some of the earliest BB4W libraries ever written, at a time when my understanding of the Windows GUI was poor and my experience with other GUI frameworks was zero! If BB4W is to be competitive it needs an entirely new approach to supporting the Windows GUI.

One thing that worries me, though, is that several people in this group (and the wider BB4W user community) probably have no experience of any other GUI framework. They therefore cannot see just how awful the existing WINLIBx libraries are, because they are all they have ever known! This is a recipe for disaster.

Perhaps I could ask everybody reading this (yes, that means you) to give a brief resume of their experiences with other Windows GUI frameworks and what they can bring to the party if we are to get this GUILIB idea off the ground.

Richard.
User IP Logged

Andy Parkes
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 25
xx Re: The future of BBC BASIC for Windows
« Reply #14 on: Mar 12th, 2012, 11:37am »

Hi All,

As I was reading through the messages thus far, I began by thinking that the WINLIBx libraries were adequate for their respective purposes. But even so, over the years I have written several simple functions and procedures to facilitate my use of these libraries, typically things that just take the monotony out of enabling dialogue controls etc.

I am sorry to say that I have no experience of other Windows GUI frameworks, and I had assumed that WINLIBx was about as easy as it got. However, I have long since noticed the limitations of WINLIBx. As Richard said, at the beginning, difficulty increases a lot, with user interface complexity. You guys - and some other folks - have written very helpful articles in the BB4W Wiki. Although I have been able to make good use of this, and increase my repertoire, there is a lot of useful work in both in the Wiki and the reference manual, which could be put at people’s fingertips by structuring it in a library. I think a 'List View' control is but one example of something crying out for library support.

I agree with Richard’s suggestion that the limitations of the library interface to the GUI, is one of the weaker aspects of BB4W. GUI programming does matter. I think most programmers get their kicks out of seeing what other people can do with their programs. Most people use Windows, most people want the Windows GUI.

I take Richards point that I (we) may be slightly delusional about the relative value of WINLIBx. Let’s first take GUILIB as far as we can, then see how we feel about WINLIBx.

The trial version of BB4W without the time limit is most helpful, and makes it easy for someone to use BB4W as a platform for teaching programming.

It is difficult for me to say at this point just how I might be of service. I'm certainly not going to be pushing the frontiers of this, but I can probably reconstitute things that are already within the scope of the Wiki and manual, into the given library format. I’m still (slooowly!) learning assembly language, so I won’t be doing anything technical!

If I was doing something like this myself, I would start with a list of what I would like to include (with descriptions for each item, stating how I would like to see it implemented – that is to say, primarily a description of how it should look from the point of view of someone using the library).

This idea is rather jumping the gun, but if it is the case that GUILIB ends ups comprising hundreds of functions and procedures, it might be nice to have a tool, which weeds out the hundred or so which are not actually used by a particular program. A good example of this is DrWIMP , another BASIC library that is similar in concept to that which we are now proposing. DrWIMP is a 'GUILIB' for use with RISC OS BASIC V. RISC OS does not offer the variety that Windows does, yet even this single library contains approximately 292 functions and procedures. It gets past the drag factor with a linker.

I have not given this much thought yet, but DrWIMP is perhaps a good example of a library that makes event driven programming feel ‘natural’ in an intrinsically procedural programming language. The library is supplied with a skeleton application. The skeleton application contains predefined functions, which are called by the library depending upon the event which needs handling. I can’t remember the correct names of the functions, but as you would expect there is something along the lines of, FNuser_mouseClicked, FNuser_mouseRollOver, FNuser_mouseEnterWindow, FNuser_mouseLeaveWindow, FNuser_windowMoved, FNuser_windowResized etc. Then all the programmer has to do is fill each function with code to filter the window handle, button handle, mouse button used (all passed to each function) etc., and generate the appropriate response. The values returned from these functions provide a way of optionally returning values to the DrWIMP library depending upon the outcome of the filtered mouse click etc.

It’s been a while since I last used it, but I do recall DrWIMP being very easy to use, and also that it was a significant enabler under RISC OS, partly because BASIC V does not have something equivalent to ON SYS etc., also the RISC OS API seems to me now, to be more difficult than the Windows API, but that might just be the effect of time.

It’s probably worth mentioning that I'm ISP challenged (connection today is courtesy of my very noisy local library). I can't say when I'll be back, but I will be! In the mean time, I'm going to download and install the trial version of LBB to see if there is anything I can glean.

Regards

Andy Parkes
User IP Logged

DDRM
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 321
xx Re: The future of BBC BASIC for Windows
« Reply #15 on: Mar 13th, 2012, 09:54am »

Hi Richard,

Sorry for the delay in responding, but it’s been rather a busy time. I AM interested, and I DO think there is potential for improvement.

One comment before I start on the main response. I suspect you tend to see BB4W as a way of producing high-class applications for the Windows environment, and so it is. Making that easier is highly desirable, and will undoubtedly increase its appeal. However, I suspect that many, perhaps most, users are beginners or relatively low level hobbyists, for whom the simplicity and immediacy of the language is very appealing. The ability to give one or two parameters, do some calculations, and then plot a simple graph, all in the main window, and all in a handful of lines of code, is very rewarding. I would be very sad if we lost that simple, basic, underlying approach in moving more towards a GUI-oriented approach, where one has to faff about getting the interface sorted before you can do anything with it!

In response to your original question on this strand, I agree that BB4W can do virtually everything I would want to do in the context of Windows programming, but that the library support for API commands could be better, and make life easier. Even more detailed Help would help - for example, the Help for many of the libraries gives examples of the style codes to do obviously helpful things, but not the full list. I appreciate adding ALL options in each place isn’t practical, but it does mean often going away and having to find (somewhere else) what those options, and either the values or the variable names, are.

Most of my programming experience is in various dialects of BASIC, going back into the 80s, though I was also competent (in my own, rather limited terms) in Turbo Pascal. In terms of languages that used the Windows interface, I have really only used Visual Basic and BB4W. Probably because of my background, I HATED VB, because it was SO focussed on event-driven programming, and a lot of the time I was interested in programs which would be doing a lot in the background, and then showing me the results - for me, then, finding BB4W was a blessing and a great relief. Having said that, the VB way of doing things - design the interface elements, and then put code in to make them all work - works very well for that kind of application.

One thing that I particularly liked in VB was that one could set or read parameters of a control directly - so, for example (and forgive me if the syntax is not exactly correct - I don’t have VB on this computer, and have barely used it since discovering BB4W) to set or read the contents of an edit control on simply wrote

editbox1.text=”Hello world!”

Indeed, one can use them as variables in an expression. This is much more user friendly (to my mind) than having to use

SYS "SetDlgItemText", !dlg%, id%, text$.

My guess is that this would be difficult to implement directly in BB4W, and is what you mean when you say that LB is different because it makes the GUI components an intrinsic part of the language (or something like that - can’t find the reference to hand). I wonder though whether it would be possible to handle this via a level of abstraction. I haven’t thought through how this would have to work, but could you have a structure associated with each control, containing its key (user settable/readable) characteristics, and then hide all the systems calls in the background, via a library? That might mean

PROCGUI_Write(editbox1.text,”Hello world!”) , or boxcontents$=FNGUI_Read(editbox1.text$),

for example. Then each time you create a new control, an associated structure would be made, containing default parameters (perhaps filled via DlgEdit or an equivalent).

Would it be possible and useful to provide a similar abstraction for MODE, PLOT and some of the VDU codes? For example, to be able to
PROCGraphics_SetMainWindow(xres%,yres%,bigchars%,colours%)
PROCGraphics_Trianglefill(x1%,y1%,x2%,y2%,x3%,y3%,colour%).

Best wishes,

David
« Last Edit: Mar 13th, 2012, 09:56am by DDRM » User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: The future of BBC BASIC for Windows
« Reply #16 on: Mar 13th, 2012, 11:51am »

on Mar 13th, 2012, 09:54am, DDRM wrote:
The ability to give one or two parameters, do some calculations, and then plot a simple graph, all in the main window, and all in a handful of lines of code, is very rewarding. I would be very sad if we lost that simple, basic, underlying approach

I can't see that there's any prospect of 'losing' that ability (after all I'm not proposing any changes to BB4W itself!). As the likes of Jonathan Harston emphasise, graphics are not actually 'part' of BBC BASIC anyway: they are an OS feature which is emulated in BB4W to improve compatibility with the BBC Micro and Acorn Archimedes.

Richard.
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: The future of BBC BASIC for Windows
« Reply #17 on: Mar 13th, 2012, 12:02pm »

on Mar 13th, 2012, 09:54am, DDRM wrote:
Then each time you create a new control, an associated structure would be made

You seem to be talking about Object Oriented programming here. I have wondered to what extent a possible GUILIB could/should be integrated with CLASSLIB, but I can see potential for an adverse reaction from users if they are forced to learn and use the (somewhat kludgey) OO syntax that CLASSLIB requires. Bear in mind that CLASSLIB (as recently improved by Jon Ripley) represents the 'state of the art' as far as a BB4W OO library is concerned; I don't think it's possible to do much better without modifying the language.

Richard.
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: The future of BBC BASIC for Windows
« Reply #18 on: Mar 13th, 2012, 5:46pm »

on Mar 13th, 2012, 09:54am, DDRM wrote:
to set or read the contents of an edit control on simply wrote
Code:
editbox1.text=”Hello world!” 

That's similar to the Liberty BASIC syntax:
Code:
#window.editbox1 ”Hello world!” 

but of course BBC BASIC has nothing similar, and modifications to the language are not on the agenda.

Options one would have in BBC BASIC include:

The current way:
Code:
SYS "SetWindowText", hctrl%, text$ 

A minimal thin wrapper (basically just a cheat to make it look more native):
Code:
PROC_SetText(hctrl%, text$) 

A more hierarchical approach:
Code:
PROC_SetText(hdlg%, idctrl%, text$) 

Using a structure-like syntax (but I'm not sure this is practical, because BB4W doesn't support creating a structure dynamically):
Code:
PROC_SetText(dlg.ctrl, text$) 

The Object Oriented approach e.g. using CLASSLIB:
Code:
PROC(ctrl.SetText)(text$) 


Do any of these particularly appeal? If not, have you any suggestions for an alternative?

Richard.
User IP Logged

DDRM
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 321
xx Re: The future of BBC BASIC for Windows
« Reply #19 on: Mar 14th, 2012, 10:05am »

Hi Richard,

I guess it could be a bit like OOP, but that wasn't really what I had in mind (I don't want to encapsulate the methods with the data as an object) - I envisioned a set of functions and procedures with a "BB4W feel" to them, more like your second option:

Code:
PROC_SetText(hctrl%, text$) 


In this particular case, as you say, it is largely cosmetic, but PROC_ReadText will be a bit more complicated (though still given in the manual), especially for multi-line dialogue boxes, and other things are more complicated still.

In VB you can change the size/position/characteristics of windows and controls directly, in a similar way, and it would be nice to be able to do this in BB4W, too.

My “level of abstraction” was the idea that you could have ?an array of structures? (size set when you call GUILibInit) in the background that stored the details for each control when it was created. For example, it would store which window/dialogue box handle it was associated with, so you don’t need to ask for hdlg%, and what control type it is, so that the routines can handle them appropriately. Of course it would also need to store content, any constraints (bounds for scroll bars etc), position, size, style, etc.

The idea would be that to access/change information relating to a control, you would use the appropriate function or procedure, with either the id% or a more user-friendly alias: “client_name”; again the alias would be stored in the structure and looked up when required. Alternatively, and faster I presume, someone cleverer than me could write a utility [pedant mode] should that be AN utility? [/pedant mode] to convert all the aliases to their equivalent IDs, a la the Windows constants utility.

Using an alias might actually require the parameter to be a quoted string, which is a bit ugly: it would be nicer if you could treat it like a variable name, but I’m not sure I could disentangle that without causing a “no such variable” error. Maybe you could...

Would it be possible/useful/desirable to cause controls which need initialising AFTER a dialogue box is shown to have that happen automatically with PROC_showdialogue? The relevant information could be provided when the control is first created, and then PROC_showdialogue could look up the associated controls, and initiate them as required?

As you have said, all these things CAN be done in BB4W, but a lot of people seem to be scared of even CONSIDERING using SYS calls, even when it is a straight cut and paste from the manual. It’s largely about wrapping these complexities up in a familiar, consistent form.

Hope that makes some sort of sense....

D
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: The future of BBC BASIC for Windows
« Reply #20 on: Mar 14th, 2012, 2:49pm »

on Mar 14th, 2012, 10:05am, DDRM wrote:
I guess it could be a bit like OOP

VB is Object Oriented.

Quote:
In VB you can change the size/position/characteristics of windows and controls directly, in a similar way, and it would be nice to be able to do this in BB4W, too.

I have never programmed in VB, so can you give an example of the sort of syntax you have in mind? Changing the size/position/style of a control after a dialogue box has been opened is not something I had anticipated supporting (other than via direct API calls).

Quote:
For example, it would store which window/dialogue box handle it was associated with, so you don’t need to ask for hdlg%, and what control type it is, so that the routines can handle them appropriately. Of course it would also need to store content, any constraints (bounds for scroll bars etc), position, size, style, etc.

Are you proposing dispensing with the conventional dialogue box template and creating the dialogue box in an alternative, non-standard, way? Admittedly that's exactly what LBB does, but I hadn't envisaged GUILIB departing so radically from the 'norm'.

Quote:
Would it be possible/useful/desirable to cause controls which need initialising AFTER a dialogue box is shown to have that happen automatically with PROC_showdialogue?

What would be the advantage?

Quote:
The idea would be that to access/change information relating to a control, you would use the appropriate function or procedure, with either the id% or a more user-friendly alias: “client_name”

Because it will always be necessary to do some things using direct Windows API (SYS) calls - that's inevitably the case in both VB and LB too - it will be important to ensure that the design of any GUILIB library doesn't make that more difficult than it needs to be. That suggests to me that it will always be better to refer to controls in ways that Windows understands - i.e. handles and/or IDs - rather than some BB4W-specific alias notation.

Quote:
Hope that makes some sort of sense....

Because of my lack of knowledge of Visual Basic many of the concepts you have described are unfamiliar to me. Can you perhaps illustrate them with some examples in a suggested BB4W syntax?

Richard.
User IP Logged

DDRM
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 321
xx Re: The future of BBC BASIC for Windows
« Reply #21 on: Mar 15th, 2012, 3:33pm »

Hi Richard,

Quote:
I have never programmed in VB, so can you give an example of the sort of syntax you have in mind?


here’s a clip in VB:
Code:
Form4.Left = Form2.Left
Form4.Top = Form2.Top + Form2.Height
Form4.Visible = True
drawgraphs
calclanes
sumlanes
inited = True
Form3.Left = Form2.Left + Form2.Width
Form3.Top = Form2.Top
Form3.Visible = True
 

Here I have read a picture of (unknown) size into form2 and displayed it, and I can then position form4 beneath it, and form 3 to the right of it. Form4 will contain some densitometry data from the picture (of an electophoresis gel), while form3 is the controls for subsequent processing (adjusting lane positions, etc).

Quote:
Changing the size/position/style of a control after a dialogue box has been opened is not something I had anticipated supporting (other than via direct API calls).


In another program, I changed the size of the form dynamically to hide or reveal some of the controls - effectively an "easy" or "advanced" interface. By changing the control.visible parameter you can also hide or reveal controls. I think this is really convenient. I guess it is pretty simple to hide or show components, as it is windows, so it would be a pretty thin wrapper!

Quote:
Are you proposing dispensing with the conventional dialogue box template and creating the dialogue box in an alternative, non-standard, way? Admittedly that's exactly what LBB does, but I hadn't envisaged GUILIB departing so radically from the 'norm'.


No, I thought creating the dialogue box and the controls would be essentially unchanged: the only difference would be that the functions creating them would stick the data into an array of structures, so that subsequent calls to associated functions could look up the data they needed.

Quote:
What would be the advantage?

[of automatically initialising controls when a dialogue box is made visible]. Well, you could set everything up in one place at one time.

Quote:
Because it will always be necessary to do some things using direct Windows API (SYS) calls - that's inevitably the case in both VB and LB too - it will be important to ensure that the design of any GUILIB library doesn't make that more difficult than it needs to be. That suggests to me that it will always be better to refer to controls in ways that Windows understands - i.e. handles and/or IDs - rather than some BB4W-specific alias notation.

I think that’s probably right, and of course all the windows controls would still have handles/IDs. I just think it’s easier to remember that a control is called “client_name” rather than that its ID is 103. It wouldn’t be either/or, and indeed you would probably want to have equivalent functions:

name$=FN_GUI_GetTextN(“client_name”)
name$=FN_GUI_GetText(103)

Quote:
Because of my lack of knowledge of Visual Basic many of the concepts you have described are unfamiliar to me. Can you perhaps illustrate them with some examples in a suggested BB4W syntax?


I’ll try and do a small example, but I can’t promise it today (I have a large chunk of a draft project to read for a student I’m seeing tomorrow morning...).

Best wishes,

D
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: The future of BBC BASIC for Windows
« Reply #22 on: Mar 15th, 2012, 6:05pm »

on Mar 15th, 2012, 3:33pm, DDRM wrote:
here’s a clip in VB

I was hoping for some proposed BBC BASIC syntax. Only in an OO language will a simple 'assignment' like:

Code:
Form4.Left = Form2.Left 

have an 'action'. In BBC BASIC it fundamentally cannot do anything other than to set the variable 'Form4.Left' to a new value.

Quote:
I guess it is pretty simple to hide or show components, as it is windows, so it would be a pretty thin wrapper!

I cannot see the point of thin wrappers which add no functionality; to me they are just a means of obfuscating the Windows API. If the user learns how to do something by calling the Windows API directly it's a valuable skill which will serve him well if he advances to using another language, like C++. On the other hand learning a BB4W-specific syntax is a dead-end; if he moves to another language he will have to forget it and start again from scratch.

Quote:
No, I thought creating the dialogue box and the controls would be essentially unchanged

That implies quite a lot of data duplication (parameters of controls would have to go into the dialogue box template and into your 'structures'). I'm always uneasy about duplication of this sort; it's inelegant and you risk obscure side-effects if the two copies get out-of-step.

I think this thread has come to the end of the road. My thanks to everybody who has taken the trouble to contribute.

Richard.
User IP Logged

DDRM
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 321
xx Re: The future of BBC BASIC for Windows
« Reply #23 on: Mar 28th, 2012, 10:48am »

Hi Richard,

I know you have declared this strand closed, but I have continued to have a bit of a play at the kinds of things I was interested in.

I started by looking at modifying the dialogue box template directly, as you implied, starting with Winlib2 as a teaching aid, but I have strayed away from that idea, because what I want is to be able to manipulate the dialogue box on the fly - I often use a dialogue box as a controls window, and leave it open all the time, but I may wish to be able to provide a simpler or more complex interface, depending on context.

I agree with you to some extent about providing very thin wrappers to obscure the API from the user, but I thought that the discussion started off by acknowledging that one could do virtually anything you wanted to in BB4W, but that many people were scared to do so, and we wanted to make it more approachable. A further counter-argument is that by providing them with a library (the code of which they can inspect) they can use it easily if that's all they want, or they can use it as a teaching aid, to see (a) how easy it is, and (b) have a sample of what to do. For example, the scaling of locations in dialogue box units is straightforward once you understand how to do it, but it took me quite a long time (even after I'd found Michael Hutton's posts on the Yahoo forum, which suggest he had also banged his head on it for a while). Another thing I found tricky was finding the handle for the controls: once I knew how to do it, I found that it is in fact in the manual, but it wasn't obvious to me.

I have posted a file called "potential winlib2 extensions.bbc" in the libraries section of the files section of the yahoo forum. This is essentially a testbed, but includes a set of small procedures and functions that I think might be more generally useful.

The program in itself doesn't do anything useful (draws some shapes in the main window, purely as an indication that the buttons etc are doing what they are meant to. Controls jump around in the dialogue box in an alarming and very annoying way - of course one would never actually do this, but it is just to test out the functions.

In some cases I have provided a proc/function as a very thin wrapper (for example, PROCsetdlgtext) - in that case because it is a logical pair to FNgetdlgtext (which is stolen straight from the manual). In others, such as GetWindowRect, I haven't bothered, which may be inconsistent - one could of course easily add these.

I'd be interested to know if anyone else thinks this kind of thing would be useful.

Best wishes,

David

User IP Logged

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

| |

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