LB Booster
« reports in text windows »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 04:21am



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: reports in text windows  (Read 474 times)
Alincon
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 147
xx reports in text windows
« Thread started on: Sep 20th, 2016, 01:02am »

Besides attempting to change the menu bar (see 'another flaky idea'), there are other problems with printing a report to a text window.
The user can alter the report (it is a text editor), unless the style 'enable' is used, but then scrolling does not work.

I have been working on using a list box as a printing medium, both on screen and on paper. Users can not change the report, you can scroll and it's easy to lprint the report:

Code:
[teamList]
    call winCntr,710,600  'center, sizes
    statictext #rpt.st1, "     League   Division    City          Name               Manager",0,0,700,20
    listbox #rpt.lb,rptx$(, [teamListPrnt],0,20,700,560
    Stylebits #rpt.lb, _LBS_NOSEL, 0, 0, 0
    Stylebits #rpt, 0, _WS_MAXIMIZEBOX , 0, 0
    open "LIST OF TEAMS  -  (click to print)" for dialog as #rpt
    #rpt, "trapclose [teamListExit]"
    #rpt, "font consolas 12 "           'fixed width font
    #rpt.lb, "singleclickselect"
    rptOpen=1

    files path$, info$(
    fc = val(info$(0, 1))
    for cf = 1 to fc
        foldName$ = info$(cf, 0)
        path2$ = foldName$ + "\aaaTeam.ini"
        open path2$ for input as #ini
            input #ini, teamLeague$, teamDivision$, teamCity$, teamName$, teamMgr$ 
        close #ini
        rptx$(cf) = space$(6); tb$(teamLeague$,10); tb$(teamDivision$,10); tb$(teamCity$,12); _
              tb$(teamName$,18); teamMgr$ 
    next
    sort rptx$(), 1, fc  ' sort to league, division
    #rpt.lb, "reload"
    wait

 [teamListPrnt]
    #rpt.lb, "selectindex 0"
    tlp$ = "No"  ' default response
    prompt "Print this report?"+chr$(13)+"Yes or No"; tlp$
    if left$(lower$(tlp$),1) <> "y" then wait
 [tlpLoop]
    gosub [tlpHdgs]
    for n = 1 to fc
        lprint  rptx$(n)    ' this is the key line: printing each entry in the listbox
    next
    dump
    wait

 [tlpHdgs]
    tlpPgCtr = tlpPgCtr + 1
    lprint space$(20);"List of Teams as of ";date$();space$(10);"Page "; tlpPgCtr
    lprint
    lprint "     League   Division    City          Name               Manager"
    return
    wait
 


For multi-page reports you would need to add title and hdg to each page, of course.

r.m.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: reports in text windows
« Reply #1 on: Sep 20th, 2016, 06:35am »

on Sep 20th, 2016, 01:02am, Alincon wrote:
The user can alter the report (it is a text editor), unless the style 'enable' is used, but then scrolling does not work.

My examples have always shown the _ES_READONLY stylebit being set. Doesn't that solve this issue in a much more straightforward way than switching to a listbox?

Richard.
User IP Logged

Alincon
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 147
xx Re: reports in text windows
« Reply #2 on: Sep 20th, 2016, 3:41pm »

I said 'text editor', but I am actually using a text window.
It appears that using a readonly stylebit does not work in a text window.

Can you show a short coding example, please?

r.m.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: reports in text windows
« Reply #3 on: Sep 20th, 2016, 6:45pm »

on Sep 20th, 2016, 3:41pm, Alincon wrote:
Can you show a short coding example, please?

Here you go:

Code:
    open "Read Only Text Window" for text as #w
    hw = hwnd(#w)
    calldll #user32, "SendMessageA", hw as ulong, _
      _EM_SETREADONLY as long, 1 as long, 0 as long, r as long
    #w "The quick brown fox jumps over the lazy dog."
    wait 

Richard.
User IP Logged

tsh73
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 210
xx Re: reports in text windows
« Reply #4 on: Sep 21st, 2016, 2:32pm »

I didn't knew that "readonly" bit allows select/copy operations.
It would be nice addition to JB thread
Kind of grid view - if JB allowed it that is.
But last time I tried, texteditor version worked with LBB just fine.
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