LB Booster
« changing window title after it's opened »

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



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: changing window title after it's opened  (Read 412 times)
Alincon
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 147
xx changing window title after it's opened
« Thread started on: Jun 23rd, 2016, 02:19am »

This sub is called from multiple windows.
It is supposed to gather information from two sources and add the information to the title of the called window
It works in one program that has only one calling window,
But it does not work in a program with multiple calling windows

Code:
sub getPayerData winHdl    'handle of calling window
    WindowWidth = 380:    WindowHeight = 300 : BackgroundColor$ = "yellow"    
    stylebits #gpdWin, _DS_CENTER,0,0,0
    statictext #gpdWin.statictext0, "", 25,  32, 170,  20
    statictext #gpdWin.statictext6, "b", 25,  55,  8,  20
    statictext #gpdWin.statictext5, "Payer identification number ", 25,  32, 170,  20
    combobox #gpdWin.cbPIN, payers$(, [gpdNACSZ],25, 52, 320,  250
    statictext #gpdWin.statictext76, "c",  10, 105,  8,  20
    statictext #gpdWin.statictext20, "Payer Name and Address", 25, 82, 160,  20
    textbox #gpdWin.tbPayerName, 25, 102, 320, 20
    statictext #gpdWin.statictext77, "d",  10, 135,  8,  20
    textbox #gpdWin.tbPayerAdrs, 25, 132, 320, 20
    statictext #gpdWin.statictext78, "e",  10, 165,  8,  20
    textbox #gpdWin.tbPayerCSZ, 25, 162, 320, 20
    Stylebits #gpdWin, 0, _WS_MAXIMIZEBOX or _WS_MINIMIZEBOX, 0, 0    
    button #gpdWin.btnAdd, "&Add ", [gpdAdd], UL, 100, 200, 80, 25   
    button #gpdWin.btnAcpt, "&Accept ", [gpdEnd], UL, 200, 200, 80, 25   
    open "GET PAYER DATA" for window as #gpdWin
    #gpdWin, "trapclose [gpdEnd]" 
    #gpdWin.cbPIN,"font 10";
    
 [gpdLoop]
    wait
    
 [gpdNACSZ]
    #gpdWin.cbPIN, "selection? x$"   
    #gpdWin.tbPayerName, word$(x$,1,"|")
    #gpdWin.tbPayerAdrs, word$(x$,2,"|")
    #gpdWin.tbPayerCSZ, word$(x$,3,"|")                    
    #gpdWin.cbPIN, "!";word$(x$,4,"|")
    gpdName$ = word$(x$,1,"|")
    gpdAdrs$ = word$(x$,2,"|")
    gpdCSZ$ = word$(x$,3,"|")
    gpdPIN$ = word$(x$,4,"|")
    wait
    
 [gpdAdd]  
    #gpdWin.cbPIN, "contents? gpdPIN$"      
    #gpdWin.tbPayerName, "!contents? gpdName$"
    #gpdWin.tbPayerAdrs, "!contents? gpdAdrs$"
    #gpdWin.tbPayerCSZ, "!contents? gpdCSZ$"
    payerCtr = payerCtr + 1  
    payers$(payerCtr) = gpdName$ +"|"+ gpdAdrs$ +"|"+ gpdCSZ$ +"|"+ gpdPIN$
    notice "Payer Added to table"+chr$(13)+payers$(payerCtr)
    sort payers$(),1,payerCtr
    #gpdWin.cbPIN, "reload"    
    wait
   
 [gpdEnd]  
   ' if gpdName$ = "" then
   '     notice "No Payer Name data"
   '     goto [gpdLoop]
   ' end if
  ' close #gpdWin  
   
 [getHdSp]    'get head or spouse or both and add to  window title
    WindowWidth = 140:    WindowHeight = 140 : BackgroundColor$ = "red"
     radiobutton #filer.rbHead, headFirstName$,[filerEnd],[filerLoop],20,20,120,20
    radiobutton #filer.rbSpouse, spouseFirstName$,[filerEnd],[filerLoop],20,45,120,20
    radiobutton #filer.rbBoth, "Both", [filerEnd],[filerLoop],20,70,70,20
    Stylebits #filer, 0, _WS_MAXIMIZEBOX or _WS_MINIMIZEBOX, 0, 0    
    open "Select Filer(s)" for window as #filer
    #filer, "trapclose [filerEnd]" 
 [filerLoop]
    wait
 
 [filerEnd]
    #filer.rbHead, "value? rbHd$"   : notice "head "+ rbHd$
    if rbHd$ = "set" then
         winName$ = headFirstName$
         divHdSp$ = headFirstName$
    end if
    #filer.rbSpouse, "value? rbSp$" : notice "spouse "+ rbSp$
    if rbSp$ = "set" then 
        winName$ = spouseFirstName$
        divHdSp$ = spouseFirstName$
    end if
    #filer.rbBoth, "value? rbBoth$" : notice "both "+ rbBoth$
    if rbBoth$ = "set" then 
        winName$ = headFirstName$ + " and " + spouseFirstName$
        divHdSp$ = "Both"
    end if
notice winName$
    'close #filer
    
   ' hWin = hwnd(#div)    'change window caption
    caption$ = " 1099 DIVIDENDS:   "; upper$(gpdName$);"   ";upper$(winName$) 
    calldll #user32, "SetWindowTextA",winHdl as ulong,caption$ as ptr,result as boolean
    end sub 
     close #filer 
     close #gpdWin   

 


Here is the table of payers: (note the "|" word breaks)

Wells Fargo|2801 Market St|St Louis, MO 63103|23-2384840
Ameriprise|10 Ameriprise Center|Minneapolis, MN 55474|41-1667086
UBS Fin Svcs|1000 Harbor Blvd|Weehawken, NJ 07086|13-2638166

r.m.
User IP Logged

Alincon
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 147
xx Re: changing window title after it's opened
« Reply #1 on: Jun 24th, 2016, 7:02pm »

Well, I can now say that the program that fails in LBB works in LB4.5
In LBB the second window vanishes and the program seems to die.

r.m.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: changing window title after it's opened
« Reply #2 on: Jun 24th, 2016, 9:07pm »

on Jun 24th, 2016, 7:02pm, Alincon wrote:
Well, I can now say that the program that fails in LBB works in LB4.5
In LBB the second window vanishes and the program seems to die.

Therefore run it in LB 4.5.0! You've not provided any information which would allow me or anybody else to discover why it's not working in LBB.

After today's shocking developments in the U.K., I don't even want to live any more.

Richard.
User IP Logged

Alincon
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 147
xx Re: changing window title after it's opened
« Reply #3 on: Jun 25th, 2016, 12:43am »

Never mind my stupid little program.
I, too, am terribly disappointed by the vote to leave the EU.

r.m.
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