|
Post by metro on Mar 23, 2019 19:04:29 GMT -5
it could be I'm at this far too early in the day and I am missing something simple but my testing is showing I can't have more than one combobox on a window
' NOTE STORAGE OF CURRENT PRICE IS NOT WORKING 'MAY HAVE TO GO BACK TO YAHOO PRICE ' Nomainwin 'Form created with the help of Freeform 3 v07-15-08 'Generated on Nov 15, 2011 at 19:52:09 nomainwin dim name$(12) dim ticker$(100) [setup.main.Window] '-----Begin code for #main ' nomainwin WindowWidth = 940 WindowHeight = 740 UpperLeftX=int((DisplayWidth-WindowWidth)/2) UpperLeftY=int((DisplayHeight-WindowHeight)/2) '-----Begin GUI objects code 'menu #main, "&File" , "E&xit", [quit.main] ' statictext #main.st.1,"Type",12,118,100,20 ' statictext #main.st.3,"Month",140,118,100,20 ' statictext #main.st.4,"Year",245,118,100,20 'statictext #main.st.5,"Last Price",355,118,100,20 'statictext #main.st.6,"Target Price",454,118,100,20 ' graphicbox #main.graphicbox1, 10, 32, 915, 70 groupbox #main.groupbox4, "BEST BUY CALCULATOR", 5, 15, 925, 100
combobox #main.comb3, ticker$(), [combobox3], 40, 47, 100, 100 combobox #main.comb5, array5$(), [combobox4], 5, 142, 100, 100 ' combobox #main.comb6, array6$(), [combobox3], 115, 142, 100, 100 ' combobox #main.comb7, ayear$(), [combobox3], 225, 142, 100, 100
' textbox #main.tbprice, 335, 140, 100, 25 ' textbox #main.textbox9, 445, 140, 100, 25 ' button #main.button10,"Re-Calc",[load_listbox], UL, 555, 140, 100, 25 ' button #main.button11,"Fetch",[fetchdata], UL, 150, 45, 100, 25 ' button #main.button12,"CLEAR ALL",[del_all], UL, 660, 140, 100, 25 ' button #main.button13,"MY LIST",[bulkload], UL, 755, 140, 100, 25 ' button #main.button14,"CLEAR LIST",[clearLB], UL, 45, 640, 100, 25 ' button #main.button15,"LOAD LIST",[loadLB], UL, 155, 640, 100, 25
'-----End GUI objects code open "test" for window as #main wait [combobox3] [combobox4] wait [load_listbox] [fetchdata] [del_all] [bulkload] [clearLB] [loadLB] wait [quit.main] close #main end
EDIT, yep up far too early... you must dimension the array's for each combobox otherwise lb5 crashes Lb4.5.1 is a bit more tolerant
|
|
|
Post by metro on Mar 25, 2019 2:28:12 GMT -5
I have re-named this post to incorporate other hickups that are found with comboboxes
I have found there is a difference with the displaying of the first selected item in a combobox compared with lb4.5 with 4.5 the item is initially highlighted and pressing the arrow on the side results in a drop down list, you can then press the first letter of the choice you want and the already selected item will disappear and the first item starting with the letter you chose will fill the box.
With lb5(linux) the original text (item) remains and your selected letter is prepended to the existing item. Crikey I hope that makes sense
nomainwin WindowWidth = 940 WindowHeight = 740 UpperLeftX=int((DisplayWidth-WindowWidth)/2) UpperLeftY=int((DisplayHeight-WindowHeight)/2) '-----Begin GUI objects code
combobox #main.combobox3, ticker$(), [combobox3] , 40, 7, 100, 100 'LOADCODES dim ticker$(100) allcodes$="AGL,AIO,AMC,AMP,ANZ,APA,ARI,ASX,AWC,AZJ,BEN,BHP,BLD,BLY,BOQ,BSL,BXB,CBA,CCL,CFX,CIM,CPA,CPU,CSL,CSR,CWN,DJS,DXS,EGP,FBU,FLT," allcodes$=allcodes$+"FMG,FOX,FXJ,GMG,GNC,GPT,HVN,IAG,IFL,ILU,IOF,IPL,JHX,LLC,MGR,MQG,MTS,MYR,NAB,NCM,ORG," allcodes$=allcodes$+"ORI,OSH,OZL,PEM,QAN,QBE,RIO,RMD,RRL,SEK,SGM,SGP,SHL,STO,SUN,SYD,TAH,TCL,TEN,TLS,TOL,TTS,TWE,VAH,WBC,WDC,WES,WOR,WOW,WPL,WRT,XJO" token$ = "?" while token$ <> "" index = index + 1 token$ = word$(allcodes$, index,",")
ticker$(index)= token$ print ticker$(index) wend open "test combo" for window as #main print #main.combobox3, "selectindex "; 1 '#main.combobox3 setfocus() '#main.combobox3 select() wait
[combobox3] wait
|
|
fox
Junior Member
Posts: 66
|
Post by fox on Mar 25, 2019 11:47:40 GMT -5
If I understood well the first problem, please, try this:
nomainwin WindowWidth = 800 WindowHeight = 300 combobox #main.cbox1, comb$(), [combx1] , 40, 12, 100, 100 combobox #main.cbox2, comb1$(), [combx2] , 240, 12, 100, 100 dim comb$(100) dim comb1$(100) ind$ = "" ind$ = "X0123456789Y?" for a = 1 to 10 comb$(a) = mid$(ind$,a,3) comb1$(a) = mid$(ind$,a,4) next a open "CheckCombo" for window as #main print #main, "trapclose [quit]" print #main.cbox1$, "selectindex "; 1 print #main.cbox2$, "selectindex "; 1 wait [combx1] wait [combx2] wait [quit] confirm "Close?"; yes$
if yes$ = "no" then wait
close #main end
If I didn't understand the problem, please, I beg your pardon. With my OS this runs well. fox
|
|
|
Post by metro on Mar 25, 2019 12:19:58 GMT -5
Thanks for the input fox, I'm not sure if you are responding to my first or second post but your code raised an interesting point. the second combo works as it should and then after you use the second combo (first) the first combo (left one) will function correctly. BUT if you use the left combo first it errors as I described earlier The original error only occurs the first time a combo is used. after that if will function correctly until you re-run your code. With my code the lb5 selection 1 is not highlighted when first selected (maybe lost focus)
I also note the drop down part of the combo will separate
away from the window(combo) if you move the window with the mouse.
you can see in my screen shot (second form) the letter I hit is prepended to the selection 1 but lb4.5 will search for the first matching choice
|
|
fox
Junior Member
Posts: 66
|
Post by fox on Mar 25, 2019 13:36:14 GMT -5
I tried to solve first problem..."I can't have more than one combobox on a window". For the question about error if you use first the left combobox I may suggest to create (for testing) a button which go to a branch label, which alternately (every time you press button) cause a "setfocus" and a "selectindex" first on combobox1 and after on combobox2 or first on combobox2 and after on combobox1. So, you can precisely verify if an error occurs and (I hope) when and why. I hope this helps. fox
|
|
|
Post by metro on Mar 25, 2019 14:53:34 GMT -5
I tried to solve first problem..."I can't have more than one combobox on a window". For the question about error if you use first the left combobox I may suggest to create (for testing) a button which go to a branch label, which alternately (every time you press button) cause a "setfocus" and a "selectindex" first on combobox1 and after on combobox2 or first on combobox2 and after on combobox1. So, you can precisely verify if an error occurs and (I hope) when and why. I hope this helps. fox Thanks fox, I did find the reason for the first problem you may have missed my final edit at the bottom of the post EDIT, yep up far too early... you must dimension the array's for each combobox otherwise lb5 crashes Lb4.5.1 is a bit more tolerant
|
|
fox
Junior Member
Posts: 66
|
Post by fox on Mar 25, 2019 16:47:05 GMT -5
Yes, ok. fox
|
|
|
Post by metro on Mar 26, 2019 3:35:43 GMT -5
I can confirm that lb5(win10) combobox has one of the same bugs that is prepending a chosen letter to the item that is initially set. however when I move the window after a drop down of the list it functions the same as lb4.5 that is the combo list contracts back to one item showing and it moves correctly with the window. so a fix required for lb5(linux)
|
|
|
Post by Carl Gundel on Mar 26, 2019 16:06:21 GMT -5
This is one of those, maybe not really a bug things. You can select the contents manually with Ctrl+A before typing. Shouldn't be too hard to change it though.
|
|
|
Post by metro on Mar 26, 2019 18:11:09 GMT -5
This is one of those, maybe not really a bug things. You can select the contents manually with Ctrl+A before typing. Shouldn't be too hard to change it though. aaahH ! ,this may lose something in the translation. we would call it a Clayton's bug down here a bug you have when you don't have a bug
it issue only appears once, when you first use the combo. after that it works as it should but the linux version does split if you move the window
|
|
|
Post by Carl Gundel on Mar 26, 2019 18:23:01 GMT -5
but the linux version does split if you move the window
Not sure I can do anything at all about the drop down list staying put when you move the window. This sort of thing is heavily dependent on the way the VM interacts with GUI events. My suspicion is that there isn't any event that tells the application that the window has moved. If it gets resolved it probably won't be by my hand. We're probably going to have index card worth of such things, but I'm sure there will be pages worth of stuff that will make it all worth putting up with.
|
|