Author |
Topic: changing window title after it's opened (Read 411 times) |
|
Alincon
Full Member
member is offline
Posts: 147
|
|
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.
|
|
Logged
|
|
|
|
Alincon
Full Member
member is offline
Posts: 147
|
|
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.
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline
Posts: 1348
|
|
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.
|
|
Logged
|
|
|
|
Alincon
Full Member
member is offline
Posts: 147
|
|
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.
|
|
Logged
|
|
|
|
|