BBC BASIC for Windows
« Turning BB into ASM code »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 10:31pm



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
 veryhotthread  Author  Topic: Turning BB into ASM code  (Read 1178 times)
DDRM
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 321
xx Re: Turning BB into ASM code
« Reply #22 on: Jun 4th, 2013, 09:29am »

Hi Matt,

At the risk of teaching my much more experienced grandmother to suck eggs, would an approach like this, using a trackbar, enable you to "fake" the list view within BB4W, so that you can read the selection position using MOUSE?

Code:
      INSTALL @lib$+"WINLIB3"
      MODE 20  :REM 800 x 600 pixels
      maxdata%=10000
      lines_onscreen%=25
      temp%=maxdata%+1
      ON CLOSE PROC_removetrackbar(tb%):PRINT "Closed":END
      ON ERROR PROC_removetrackbar(tb%):END
      REM Set up dummy data
      DIM m$(maxdata%)
      FOR x%=0 TO maxdata%
        m$(x%)="This is the text of message "+STR$(x%)
      NEXT x%
      
      REM Set up a trackbar to control which bit to look at
      tb%=FN_createtrackbar(@hwnd%,600,10,20,580,2)
      PROC_showtrackbar(tb%,maxdata%-lines_onscreen%)
      REPEAT
        top%=FN_trackbarpos(tb%)
        IF temp%<>top% THEN
          bottom%=top%+lines_onscreen%
          b$=FNblock(m$(),top%,bottom%)
          CLS
          PRINT b$
        ENDIF
        temp%=top%
      UNTIL FALSE
      PROC_removetrackbar(tb%)
      END
      
      :
      DEFFNblock(m$(),t%,b%)
      LOCAL x%,t$
      FOR x%=t% TO b%
        t$+=m$(x%)+CHR$(10)+CHR$(13)
      NEXT x%
      =t$
 


10,000 lines is a lot to control with a trackbar, but I find that this will just do it on an 800x600 window: moving the trackbar 1 pixel moves the list about 18 components. You could add "single item scroll" arrows (like an up/down control) at the top and bottom to give more fine control if required. If you are prepared to have a 1024x768 window it will probably be nicer: you could have 48 items listed, and the trackbar will be longer, and so more sensitive.

I haven't implemented the selection mechanism, but I'd just use MOUSE (or ON MOUSE), then calculate the offset from top%. That should be quick and reliable.

Obviously doing it this way will mean you will have to do a lot more "graphic design" work to make it look pretty than if you use the Windows controls, but on the other hand you don't have to wait 90 seconds for the list to repopulate....

On the whole, I'm with Richard: 10,000 items in one list is too many, but the customer is king! :-)

Best wishes,

David
User IP Logged

Michael Hutton
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 248
xx Re: Turning BB into ASM code
« Reply #23 on: Jun 4th, 2013, 1:38pm »

I like your solution David, very BB4W!

Quote:
However, each time manipulation is done, the list needs to be re-listed due to various parameter changes.


How much would the Listview change after each manipulation? You could suffer one long period where the listview is being populated first time but then change/update only the information which has changed the next time. This may help to reduce the re-population time if the user is changing things.

(for the life of me I can't imaging the data you are working on. smiley I don't want to appear silly but surely a statistical summary/method for 10,000 different data points is better? Forgive me if I am barking up the wrong tree, but I sometimes deal with massive data sets on an infrequent, but frequent enough, basis).

I would be interested in your solution. Have you thought of using COMLIB, or rather saving the information to a file maybe and viewing it all in another spreadsheet (Eg. Excel)?

Michael
User IP Logged

Matt
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 210
xx Re: Turning BB into ASM code
« Reply #24 on: Jun 4th, 2013, 9:07pm »

on Jun 4th, 2013, 09:29am, DDRM wrote:
At the risk of teaching my much more experienced grandmother to suck eggs, would an approach like this, using a trackbar, enable you to "fake" the list view within BB4W, so that you can read the selection position using MOUSE?

If the implication is that I'm more experienced than you, then I wouldn't bank on it. smiley

Thanks for your input. It's an interesting idea. I will certainly consider it.

Matt
User IP Logged

Matt
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 210
xx Re: Turning BB into ASM code
« Reply #25 on: Jun 4th, 2013, 9:25pm »

on Jun 4th, 2013, 1:38pm, Michael Hutton wrote:
How much would the Listview change after each manipulation? You could suffer one long period where the listview is being populated first time but then change/update only the information which has changed the next time. This may help to reduce the re-population time if the user is changing things.

Most of the time, with the people who use the current version, they simply track up and down the list searching for the right record (illogical perhaps, but reality). Occationally, a search is required. This will create a new list with the selected records. The new program would allow manipulation of the records.

Quote:
I don't want to appear silly but surely a statistical summary/method for 10,000 different data points is better? Forgive me if I am barking up the wrong tree, but I sometimes deal with massive data sets on an infrequent, but frequent enough, basis).

Have you thought of using COMLIB, or rather saving the information to a file maybe and viewing it all in another spreadsheet (Eg. Excel)?


The current information is viewed in Excel, but it's a very fixed format. That's the main reason for designing a program around the data.

I have to say that I do agree with most of what has been said in this thread, and, as said before, if I were designing it in a more generic way, than I would do it differently. Probably with a hierarchy style (I think Richard suggested this). However, as David said: the customer is king! If I'm going to get the customer to accept it, I'm going to have to follow his main wishes, which is to have something that resembles, on the surface, what is currently being used.

Matt
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Turning BB into ASM code
« Reply #26 on: Jun 4th, 2013, 10:00pm »

on Jun 4th, 2013, 9:25pm, Matt wrote:
I'm going to have to follow his main wishes

If it was me, I wouldn't! At the very least I would attempt to develop, and present to the customer, an alternative approach in addition to what he is currently asking for.

Richard.
User IP Logged

Matt
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 210
xx Re: Turning BB into ASM code
« Reply #27 on: Jun 5th, 2013, 04:55am »

on Jun 4th, 2013, 10:00pm, Richard Russell wrote:
If it was me, I wouldn't! At the very least I would attempt to develop, and present to the customer, an alternative approach in addition to what he is currently asking for.

Unfortunatly, I'm not much of a sales person (nor programmer, by the looks of things). I like writing programs, but 'pitching' them to a client is a different matter. This chap I'm doing this for is a old guy, pretty much set in his ways. Although not impossible, teaching an old dog new tricks can sometimes be quite difficult (which occationally, I have to be honest, also includes me!). However, all this talk on variations of the theme, does have me seriously considering other options. I'm going to play around with a non-listview option, similar to what David suggested, and hierarchy style as you did.

Thanks

Matt
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