nomainwin
'Form created with the help of Freeform 3 v07-15-08
'Generated on Nov 17, 2015 at 17:02:38
sep$ =chr$(34)+chr$(44)+chr$(34) :Blank$=Chr$(34)+"C"+Chr$(34) :Str1$ =")"+chr$(34)+">"
MyEol$ =chr$(44)+chr$(34)+chr$(34) :DDQ$ =Chr$(34)+Chr$(34)
ControlDir$=DefaultDir$+"\CTRL\"
DataDir$ =DefaultDir$+"\DAT\"
GLOBAL AsxCode$ , Dquote$,Str1$
GLOBAL OptType$ ,TransType$
[setup.main.Window]
' loadbmp "BannerImage", ControlDir$+"financeBanner.bmp"
'-----Begin code for #buy
MainWinWidth = 800
MainWinHeight = 600
WindowWidth = MainWinWidth
WindowHeight = MainWinHeight
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
'-----Begin GUI objects coderecord
graphicbox #buy.GbLine3, 3, 1, 785, 3
graphicbox #buy.GbBanner, 3, 5, 785, 60
graphicbox #buy.GbLine1, 3, 66, 785, 3
TextboxColor$ = "white"
statictext #buy.StPFolio,"Portfolio" , 20, 75, 65, 20
combobox #buy.CbPFolio, PFolio$(), [SelPFolio], 10, 95, 150, 25
statictext #buy.StBroker,"Broker" , 190, 75, 65, 20
combobox #buy.CbBroker, Brokers$(), [SelBroker], 175, 95, 100, 25
statictext #buy.StOpenDate, "Open Date", 20, 125, 65, 20
textbox #buy.TbOpenDate, 10, 145, 100, 25
statictext #buy.StOptCode, "Opt Code", 140, 125, 57, 20
textbox #buy.TbOptCode, 120, 145, 100, 25
Stylebits #buy.TbOptCode, _ES_UPPERCASE, 0, 0, 0
button #buy.Btnfind , "FIND", [SEARCH4CODE], UL, 235, 145
statictext #buy.StStyle , "Style", 20, 175, 57, 20
textbox #buy.TbStyle , 10, 195, 100, 25
Stylebits #buy.TbStyle, _ES_CENTER OR _ES_UPPERCASE,0, 0, 0
statictext #buy.StStrike, "Strike", 150, 175, 34, 20
textbox #buy.TbStrike, 120, 195, 100, 25
Stylebits #buy.TbStrike, _ES_RIGHT, 0, 0, 0
statictext #buy.StExpDate, "Expire Date", 250, 175, 70, 20
textbox #buy.TbExpDate, 230, 195, 100, 25
Stylebits #buy.TbExpDate, _ES_RIGHT, 0, 0, 0
statictext #buy.StType, "Type", 345, 175, 32, 20
textbox #buy.TbType, 340, 195, 50, 25
Stylebits #buy.TbType, _ES_CENTER OR _ES_UPPERCASE,0, 0, 0
statictext #buy.StSharesPerCon, "Shares/ Contract", 405, 175, 118, 20
textbox #buy.TbSharesPerCon, 405, 195, 100, 25
Stylebits #buy.TbSharesPerCon, _ES_RIGHT, 0, 0, 0
radiobutton #buy.RbBUY, "BUY", [CALCTOTAL], dummy,525,175,60,20
radiobutton #buy.RbSELL, "SELL", [CALCTOTAL],dummy,525,205,60,20
statictext #buy.StNumCont, "Num Contracts", 125, 220, 87, 20
textbox #buy.TbNumCont, 120 ,240, 100, 25
Stylebits #buy.TbNumCont, _ES_NUMBER, 0, 0, 0
Stylebits #buy.TbNumCont, _ES_RIGHT, 0, 0, 0
statictext #buy.StOpenBro, "Brokerage", 243, 220, 87, 20
textbox #buy.TbOpenBro, 230 ,240, 100, 25
Stylebits #buy.TbOpenBro, _ES_RIGHT, 0, 0, 0
'Stylebits #buy.TbOpenBro, _ES_NUMBER, 0, 0, 0
statictext #buy.StFees, "Fees", 350, 220, 87, 20
textbox #buy.TbOpenFee, 340 ,240, 50, 25
Stylebits #buy.TbOpenFee, _ES_RIGHT, 0, 0, 0
'Stylebits #buy.TbOpenFee, _ES_NUMBER, 0, 0, 0
button #buy.BtnCalc, " CALCULATE ", [CALCTOTAL], UL, 405, 240
statictext #buy.statictext51, "NOTES", 170, 280, 250, 40
TexteditorColor$ = "white"
texteditor #buy.textedit42, 20, 320, 450, 200
ComboboxColor$ = "white"
statictext #buy.StOpenPrice, "Open Price", 20, 220, 67, 20
textbox #buy.TbOpenPrice, 10, 240, 100, 25
Stylebits #buy.TbOpenPrice, _ES_RIGHT, 0, 0, 0
button #buy.BtnStore, " RECORD ", [SAVERECORD], UL, 530, 240
button #buy.BtnChart, " CHART ", [DISPLAYCHART], UL, 620, 240
statictext #buy.StTradeNum, "Trade Number", 520, 83, 128, 20
textbox #buy.TbNumber, 660, 77, 80, 33
stylebits #buy.TbNumber, 0,_WS_BORDER, 0, _WS_EX_CLIENTEDGE
Stylebits #buy.TbNumber, _ES_CENTER,0, 0, 0
Stylebits #buy.TbNumber, _ES_READONLY, 0, 0, 0
Stylebits #buy.TbNumber, 0,_WS_TABSTOP, 0, 0
statictext #buy.StMessage1, "DataBase Last Updated...", 20, 525, 265, 20
textbox #buy.TbGrossPrem, 620, 320, 100, 25
statictext #buy.stGross, "Gross", 540, 320, 64, 20
Stylebits #buy.TbGrossPrem,_ES_RIGHT OR_ES_READONLY,0,0,0
textbox #buy.TbTotalBro, 620, 355, 100, 25
statictext #buy.StBrokerage, "Brokerage",540, 355, 64, 20
Stylebits #buy.TbTotalBro,_ES_RIGHT OR_ES_READONLY,0,0,0
textbox #buy.TbOpenFees, 620, 385, 100, 25
statictext #buy.StFees, "Fees", 540, 385, 31, 20
Stylebits #buy.TbOpenFees,_ES_RIGHT OR_ES_READONLY,0,0,0
textbox #buy.TbNetAmount , 620, 415, 100, 25
statictext #buy.NetAmount, "NET", 540, 415, 50, 20
Stylebits #buy.TbNetAmount,_ES_RIGHT OR_ES_READONLY,0,0,0
graphicbox #buy.GbLine, 10,274, 775, 3
'-----End GUI objects code
'-----Begin menu code
menu #buy, "Edit" ' <-- Texteditor menu.
menu #buy, "&Tools","D_LoadMasterList",[DOWNLOADMATSERLIST],"UpDate Opt Data",[LOADDATA], "Delete Old Dates", [CLEANDB]
'-----End menu code
open "OPEN TRADE" for window as #buy
#buy.BtnStore,"!disable"
#buy.GbBanner, "down"
#buy.GbBanner, "drawbmp BannerImage 0 0 ;flush"
#buy.GbLine," down; fill darkgreen; flush"
#buy.GbLine1," down; fill darkgreen; flush"
#buy.GbLine3," down; fill darkgreen; flush"
#buy, "font ms_sans_serif 10"
#buy.statictext51, "!font Times_New_Roman Bold 20"
#buy.RbBUY,"SET" : TransType$="B"
#buy, "trapclose [quit.main]"
#buy.StTradeNum, "!font Times_New_Roman Bold 15"
#buy.TbNumber, "!font Times_New_Roman Bold 20";
[main.inputLoop]
' gosub [OPENDLL]
' gosub [OPENDB]
' gosub [LOADCONTROLFILE]
' gosub [SETVARIABLES]
' gosub [GETNEXTTRADENUMBER]
' gosub [UPDATETRADENUMBER] 'need to move to after record save
' gosub [LOADLASTUPDATE]
#buy.StMessage1, "DataBase Last Updated..."+ LastUpdate$
#buy.TbOptCode,"!Setfocus"
wait
[quit.main] 'End the program
close #buy
' close #sq3
' unloadbmp("BannerImage")
END