1 Star 0 Fork 10

morcc/geoda

forked from 李建成/geoda 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
GeoDa.cpp 275.70 KB
一键复制 编辑 原始数据 按行查看 历史
lixun910 提交于 2020-09-10 16:39 . #2185 init multivariate quantile lisa ui
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493
/**
* GeoDa TM, Copyright (C) 2011-2015 by Luc Anselin - all rights reserved
*
* This file is part of GeoDa.
*
* GeoDa is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GeoDa is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#undef check // undefine needed for Xcode compilation and Boost.Geometry
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <locale>
#include <locale.h>
#include <sstream>
#include <iomanip>
#include <stdlib.h>
#include <boost/thread.hpp>
#include <boost/bind.hpp>
#include <boost/foreach.hpp>
#include "ogrsf_frmts.h"
#include "cpl_conv.h"
#include <wx/utils.h>
#include <wx/sysopt.h>
#include <wx/platinfo.h>
#include <wx/wxprec.h>
#include <wx/aboutdlg.h>
#include <wx/valtext.h>
#include <wx/image.h>
#include <wx/dcsvg.h> // SVG DC
#include <wx/dcps.h> // PostScript DC
#include <wx/dcmemory.h> // Memory DC
#include <wx/xrc/xmlres.h> // XRC XML resouces
#include <wx/splitter.h>
#include <wx/sizer.h>
#include <wx/app.h>
#include <wx/sysopt.h>
#include <wx/position.h>
#include <wx/progdlg.h>
#include <wx/filedlg.h>
#include <wx/filefn.h> // for wxCopyFile and wxFileExists
#include <wx/msgdlg.h>
#include <wx/stdpaths.h>
#include <wx/regex.h>
#include <wx/numformatter.h>
#include <wx/webview.h>
#include <wx/webviewarchivehandler.h>
#include <wx/webviewfshandler.h>
#include <wx/filesys.h>
#include <wx/fs_arc.h>
#include <wx/fs_mem.h>
#include <wx/settings.h>
#include <wx/uri.h>
#include "DataViewer/DataViewerAddColDlg.h"
#include "DataViewer/DataViewerDeleteColDlg.h"
#include "DataViewer/DataViewerEditFieldPropertiesDlg.h"
#include "DataViewer/MergeTableDlg.h"
#include "DataViewer/TableBase.h"
#include "DataViewer/TableFrame.h"
#include "DataViewer/TableInterface.h"
#include "DataViewer/TableState.h"
#include "DataViewer/TimeState.h"
#include "DialogTools/DissolveDlg.h"
#include "DialogTools/CreateGridDlg.h"
#include "DialogTools/Bnd2ShpDlg.h"
#include "DialogTools/CreatingWeightDlg.h"
#include "DialogTools/CatClassifDlg.h"
#include "DialogTools/PCPDlg.h"
#include "DialogTools/ProjectInfoDlg.h"
#include "DialogTools/FieldNewCalcSheetDlg.h"
#include "DialogTools/CalculatorDlg.h"
#include "DialogTools/DataMovieDlg.h"
#include "DialogTools/ExportCsvDlg.h"
#include "DialogTools/ImportCsvDlg.h"
#include "DialogTools/RangeSelectionDlg.h"
#include "DialogTools/TimeChooserDlg.h"
#include "DialogTools/VarGroupingEditorDlg.h"
#include "DialogTools/VariableSettingsDlg.h"
#include "DialogTools/SelectWeightsDlg.h"
#include "DialogTools/SaveSelectionDlg.h"
#include "DialogTools/RegressionDlg.h"
#include "DialogTools/RegressionReportDlg.h"
#include "DialogTools/LisaWhat2OpenDlg.h"
#include "DialogTools/RegressionDlg.h"
#include "DialogTools/RegressionReportDlg.h"
#include "DialogTools/ProgressDlg.h"
#include "DialogTools/GetisOrdChoiceDlg.h"
#include "DialogTools/ConnectDatasourceDlg.h"
#include "DialogTools/ExportDataDlg.h"
#include "DialogTools/TimeEditorDlg.h"
#include "DialogTools/SaveAsDlg.h"
#include "DialogTools/LocaleSetupDlg.h"
#include "DialogTools/WeightsManDlg.h"
#include "DialogTools/PublishDlg.h"
#include "DialogTools/BasemapConfDlg.h"
#include "DialogTools/AutoUpdateDlg.h"
#include "DialogTools/ReportBugDlg.h"
#include "DialogTools/SaveToTableDlg.h"
#include "DialogTools/KMeansDlg.h"
#include "DialogTools/MaxpDlg.h"
#include "DialogTools/AZPDlg.h"
#include "DialogTools/tSNEDlg.h"
#include "DialogTools/SpectralClusteringDlg.h"
#include "DialogTools/HClusterDlg.h"
#include "DialogTools/SCHCDlg.h"
#include "DialogTools/DBScanDlg.h"
#include "DialogTools/HDBScanDlg.h"
#include "DialogTools/CreateGridDlg.h"
#include "DialogTools/RedcapDlg.h"
#include "DialogTools/MDSDlg.h"
#include "DialogTools/AggregateDlg.h"
#include "DialogTools/PCASettingsDlg.h"
#include "DialogTools/SkaterDlg.h"
#include "DialogTools/PreferenceDlg.h"
#include "DialogTools/SpatialJoinDlg.h"
#include "DialogTools/MultiVarSettingsDlg.h"
#include "DialogTools/nbrMatchDlg.h"
#include "DialogTools/quantileLisaDlg.h"
#include "DialogTools/MultiQuantileLisaDlg.h"
#include "Explore/CatClassification.h"
#include "Explore/CovSpView.h"
#include "Explore/CorrelParamsDlg.h"
#include "Explore/CorrelogramView.h"
#include "Explore/GetisOrdMapNewView.h"
#include "Explore/LineChartView.h"
#include "Explore/LisaMapNewView.h"
#include "Explore/LisaScatterPlotView.h"
#include "Explore/LisaCoordinator.h"
#include "Explore/LocalGearyCoordinator.h"
#include "Explore/LocalGearyMapNewView.h"
#include "Explore/ConditionalMapView.h"
#include "Explore/ConditionalNewView.h"
#include "Explore/ConditionalScatterPlotView.h"
#include "Explore/ConnectivityHistView.h"
#include "Explore/ConnectivityMapView.h"
#include "Explore/ConditionalHistogramView.h"
#include "Explore/ConditionalBoxPlotView.h"
#include "Explore/CartogramNewView.h"
#include "Explore/GStatCoordinator.h"
#include "Explore/MLJCMapNewView.h"
#include "Explore/MLJCCoordinator.h"
#include "Explore/ScatterNewPlotView.h"
#include "Explore/ScatterPlotMatView.h"
#include "Explore/MapNewView.h"
#include "Explore/PCPNewView.h"
#include "Explore/HistogramView.h"
#include "Explore/BoxNewPlotView.h"
#include "Explore/3DPlotView.h"
#include "Explore/WebViewExampleWin.h"
#include "Explore/Basemap.h"
#include "Explore/ColocationMapView.h"
#include "Explore/GroupingMapView.h"
#include "Explore/DistancePlotView.h"
#include "Regression/DiagnosticReport.h"
#include "ShapeOperations/CsvFileUtils.h"
#include "ShapeOperations/WeightsManager.h"
#include "ShapeOperations/WeightsManState.h"
#include "ShapeOperations/OGRDataAdapter.h"
#include "VarCalc/CalcHelp.h"
#include "Algorithms/redcap.h"
#include "Algorithms/fastcluster.h"
#include "Algorithms/distanceplot.h"
#include "wxTranslationHelper.h"
#include "GdaException.h"
#include "FramesManager.h"
#include "GdaConst.h"
#include "GeneralWxUtils.h"
#include "VarTools.h"
#include "logger.h"
#include "Project.h"
#include "TemplateFrame.h"
#include "SaveButtonManager.h"
#include "GeoDa.h"
#include "version.h"
#include "arizona/viz3/plots/scatterplot.h"
#include "rc/GeoDaIcon-16x16.xpm"
//The XML Handler should be explicitly registered:
#include <wx/xrc/xh_auitoolb.h>
// The following is defined in rc/GdaAppResouces.cpp. This file was
// compiled with: wxrc dialogs.xrc menus.xrc toolbar.xrc
// --cpp-code --output=GdaAppResources.cpp --function=GdaInitXmlResource
// and combines all resouces file into single source file that is linked into
// the application binary.
extern void GdaInitXmlResource();
IMPLEMENT_APP(GdaApp)
GdaApp::GdaApp() : m_pLogFile(0)
{
//Don't call wxHandleFatalExceptions so that a core dump file will be
//produced for debugging.
//wxHandleFatalExceptions();
}
GdaApp::~GdaApp()
{
wxLog::SetActiveTarget(NULL);
if (m_pLogFile != NULL){
fclose(m_pLogFile);
}
}
bool GdaApp::OnInit(void)
{
if (!wxApp::OnInit())
return false;
// initialize OGR connection
OGRDataAdapter::GetInstance();
// load preferences
PreferenceDlg::ReadFromCache();
// load language here: GdaConst::gda_ui_language
// search_path is the ./lang directory
// config_path it the exe directory (every user will have a different config file?)
wxFileName appFileName(argv[0]);
appFileName.Normalize(wxPATH_NORM_DOTS|wxPATH_NORM_ABSOLUTE| wxPATH_NORM_TILDE);
wxString search_path = appFileName.GetPath() + wxFileName::GetPathSeparator() + "lang";
// load language from lang/config.ini if user specified any
wxString config_path = search_path + wxFileName::GetPathSeparator()+ "config.ini";
bool use_native_config = false;
m_TranslationHelper = new wxTranslationHelper(*this, search_path, use_native_config);
m_TranslationHelper->SetConfigPath(config_path);
m_TranslationHelper->Load();
// forcing numeric settings to en_US, which is used internally in GeoDa
setlocale(LC_NUMERIC, "en_US");
// Other GDAL configurations
if (GdaConst::hide_sys_table_postgres == false) {
CPLSetConfigOption("PG_LIST_ALL_TABLES", "YES");
}
if (GdaConst::hide_sys_table_sqlite == false) {
CPLSetConfigOption("SQLITE_LIST_ALL_TABLES", "YES");
}
if (GdaConst::gdal_http_timeout >= 0 ) {
CPLSetConfigOption("GDAL_HTTP_TIMEOUT",
wxString::Format("%d", GdaConst::gdal_http_timeout));
}
CPLSetConfigOption("OGR_XLS_HEADERS", "FORCE");
CPLSetConfigOption("OGR_XLSX_HEADERS", "FORCE");
// For reaching DBF file, set SHAPE_ENCODING to "" to avoid any recoding
CPLSetConfigOption("SHAPE_ENCODING", "");
// will suppress "iCCP: known incorrect sRGB profile" warning message
// in wxWidgets 2.9.5. This is a bug in libpng. See wxWidgets trac
// issue #15331 for more details.
GdaConst::init();
CalcHelp::init();
wxImage::AddHandler(new wxPNGHandler);
wxImage::AddHandler(new wxXPMHandler);
wxXmlResource::Get()->AddHandler(new wxAuiToolBarXmlHandler);
wxXmlResource::Get()->InitAllHandlers();
//Required for virtual file system archive and memory support
wxFileSystem::AddHandler(new wxArchiveFSHandler);
wxFileSystem::AddHandler(new wxMemoryFSHandler);
GdaInitXmlResource(); // call the init function in GdaAppResources.cpp
// check crash
if (GdaConst::disable_crash_detect == false) {
std::vector<wxString> items = OGRDataAdapter::GetInstance().GetHistory("NoCrash");
if (items.size() > 0) {
wxString no_crash = items[0];
if (no_crash == "false") {
// ask user to send crash data
wxString msg = _("It looks like GeoDa has been terminated abnormally. \nDo you want to send a crash report to GeoDa team? \n\n(Optional) Please leave your email address,\nso we can send a follow-up email once we have a fix.");
wxString ttl = _("Send Crash Report");
wxString user_email = GdaConst::gda_user_email;
wxTextEntryDialog msgDlg(GdaFrame::GetGdaFrame(), msg, ttl, user_email,
wxOK | wxCANCEL | wxCENTRE );
if (msgDlg.ShowModal() == wxID_OK) {
user_email = msgDlg.GetValue();
if (user_email != GdaConst::gda_user_email) {
OGRDataAdapter::GetInstance().AddEntry("gda_user_email", user_email);
GdaConst::gda_user_email = user_email;
}
wxString ttl = "Crash Report";
wxString body;
body << "From: " << user_email << "\n Details:";
ReportBugDlg::CreateIssue(ttl, body);
}
}
}
OGRDataAdapter::GetInstance().AddEntry("NoCrash", "false");
}
int frameWidth = 1020;
int frameHeight = 80;
if (GeneralWxUtils::isMac()) {
frameWidth = 1092;
frameHeight = 80;
} else if (GeneralWxUtils::isWindows()) {
frameWidth = 1200;
frameHeight = 120;
} else if (GeneralWxUtils::isUnix()) { // assumes GTK
frameWidth = 1100;
frameHeight = 120;
#ifdef __linux__
wxLinuxDistributionInfo linux_info = wxGetLinuxDistributionInfo();
if (linux_info.Description.Lower().Contains("centos")) {
frameHeight = 180;
}
#endif
}
wxPoint appFramePos = wxPoint(80,60);
int screenX = wxSystemSettings::GetMetric ( wxSYS_SCREEN_X );
if (screenX < frameWidth) {
frameWidth = screenX;
appFramePos = wxPoint(0, 0);
}
wxFrame* frame = new GdaFrame("GeoDa", appFramePos,
wxSize(frameWidth, frameHeight),
wxDEFAULT_FRAME_STYLE & ~(wxMAXIMIZE_BOX));
frame->Show(true);
frame->SetMinSize(wxSize(640, frameHeight));
SetTopWindow(GdaFrame::GetGdaFrame());
if (GeneralWxUtils::isWindows()) {
// For XP / Vista / Win 7, the user can select to use font sizes
// of %100, %125 or %150.
// Therefore, we might need to slighly increase the window size
// when sizes > %100 are used in the Display options.
if (GdaFrame::GetGdaFrame()->GetClientSize().GetHeight() < 22) {
GdaFrame::GetGdaFrame()->SetSize(
GdaFrame::GetGdaFrame()->GetSize().GetWidth(),
GdaFrame::GetGdaFrame()->GetSize().GetHeight() +
(22 - GdaFrame::GetGdaFrame()->GetClientSize().GetHeight()));
}
}
wxPoint welcome_pos = appFramePos;
welcome_pos.y += 150;
// setup gdaldata directory for libprj
wxString exePath = wxStandardPaths::Get().GetExecutablePath();
wxFileName exeFile(exePath);
wxString exeDir = exeFile.GetPathWithSep();
// Set GEODA_GDAL_DATA
#ifdef __WIN32__
wxString gal_data_dir = exeDir + "data";
wxSetEnv("GEODA_GDAL_DATA", gal_data_dir);
//CPLSetConfigOption("GEODA_GDAL_DATA", GET_ENCODED_FILENAME(gal_data_dir));
#elif defined __linux__
wxString gal_data_dir = exeDir + "gdaldata";
wxSetEnv("GEODA_GDAL_DATA", gal_data_dir);
CPLSetConfigOption("GEODA_GDAL_DATA", GET_ENCODED_FILENAME(gal_data_dir));
#else
wxString gal_data_dir = exeDir + "../Resources/gdaldata";
wxSetEnv("GEODA_GDAL_DATA", gal_data_dir);
CPLSetConfigOption("GEODA_GDAL_DATA", GET_ENCODED_FILENAME(gal_data_dir));
#endif
// Setup new Logger after crash check
wxString loggerFile = GenUtils::GetSamplesDir() +"logger.txt";
if (m_pLogFile == NULL) {
#ifdef __WIN32__
m_pLogFile = _wfopen( loggerFile.wc_str(), L"w+" );
#else
m_pLogFile = fopen( GET_ENCODED_FILENAME(loggerFile), "w+" );
#endif
wxLog::SetActiveTarget(new wxLogStderr(m_pLogFile));
}
wxLog::EnableLogging(true);
wxLog::DisableTimestamp();
wxLog::SetComponentLevel("wx", wxLOG_FatalError);
#ifdef __DEBUG__
wxLog::SetLogLevel(wxLOG_Message);
#endif
wxString os_id = GeneralWxUtils::LogOsId();
wxLogMessage(os_id);
wxString versionlog = wxString::Format("vs: %d-%d-%d-%d",
Gda::version_major,
Gda::version_minor,
Gda::version_build,
Gda::version_subbuild);
wxLogMessage(versionlog);
wxLogMessage(loggerFile);
if (!cmd_line_proj_file_name.IsEmpty()) {
wxString proj_fname(cmd_line_proj_file_name);
wxArrayString fnames;
fnames.Add(proj_fname);
MacOpenFiles(fnames);
} else {
if (GeneralWxUtils::isMac1014plus() == false) {
wxCommandEvent ev(wxEVT_COMMAND_MENU_SELECTED, XRCID("ID_NEW_PROJECT"));
frame->GetEventHandler()->ProcessEvent(ev);
}
}
return true;
}
bool GdaApp::OnCmdLineParsed(wxCmdLineParser& parser)
{
if ( parser.GetParamCount() > 0) {
cmd_line_proj_file_name = parser.GetParam(0);
}
return true;
}
const wxCmdLineEntryDesc GdaApp::globalCmdLineDesc [] =
{
{ wxCMD_LINE_SWITCH, "h", "help",
"displays help on the command line parameters",
wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP },
{ wxCMD_LINE_PARAM, NULL, NULL, "project file",
wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
{ wxCMD_LINE_NONE }
};
void GdaApp::OnInitCmdLine(wxCmdLineParser& parser)
{
parser.SetDesc (GdaApp::globalCmdLineDesc);
parser.SetSwitchChars ("-");
}
void GdaApp::MacOpenFiles(const wxArrayString& fileNames)
{
wxLogMessage("MacOpenFiles");
wxLogMessage(fileNames[0]);
int sz=fileNames.GetCount();
if (sz > 0) {
wxWindowList::compatibility_iterator node = wxTopLevelWindows.GetFirst();
while (node) {
wxWindow* win = node->GetData();
if (ConnectDatasourceDlg* w = dynamic_cast<ConnectDatasourceDlg*>(win)) {
wxLogMessage("Close ConnectDatasourceDlg");
w->EndModal(wxID_CANCEL);
}
node = node->GetNext();
}
GdaFrame::GetGdaFrame()->OpenProject(fileNames[0]);
}
}
int GdaApp::OnExit(void)
{
return 0;
}
void GdaApp::OnFatalException()
{
wxMessageBox(_("GeoDa has run into a problem and will close."));
}
std::vector<GdaFrame::MenuItem> GdaFrame::htmlMenuItems;
GdaFrame* GdaFrame::gda_frame = 0;
bool GdaFrame::projectOpen = false;
Project* GdaFrame::project_p = 0;
std::list<wxAuiToolBar*> GdaFrame::toolbar_list(0);
void GdaFrame::UpdateToolbarAndMenus()
{
// This method is called when no particular window is currently active.
// In this case, the close menu item should be disabled.
// some change
GeneralWxUtils::EnableMenuItem(GetMenuBar(), _("File"), wxID_CLOSE, false);
Project* p = GetProject();
bool proj_open = (p != 0);
bool shp_proj = proj_open && !p->IsTableOnlyProject();
bool table_proj = proj_open && p->IsTableOnlyProject();
//bool time_variant = proj_open && p->GetTableInt()->IsTimeVariant();
bool time_variant = proj_open;
wxMenuBar* mb = GetMenuBar();
SetTitle("GeoDa");
if (proj_open && project_p) SetTitle(project_p->GetProjectTitle());
EnableTool(XRCID("ID_NEW_PROJECT"), !proj_open);
EnableTool(XRCID("ID_OPEN_PROJECT"), !proj_open);
EnableTool(XRCID("ID_CLOSE_PROJECT"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, _("File"), XRCID("ID_NEW_PROJECT"), !proj_open);
GeneralWxUtils::EnableMenuItem(mb, _("File"), XRCID("ID_OPEN_PROJECT"), !proj_open);
GeneralWxUtils::EnableMenuItem(mb, _("File"), XRCID("ID_CLOSE_PROJECT"), proj_open);
if (!proj_open) {
// Disable only if project not open. Otherwise, leave changing
// Save state to SaveButtonManager
EnableTool(XRCID("ID_SAVE_PROJECT"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_SAVE_PROJECT"), false);
UpdateRecentDatasourceMenu();
}
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_NEW_PROJ_FROM_RECENT_MENU"), !proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_SAVE_AS_PROJECT"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_EXPORT_LAYER"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_EXPORT_SELECTED"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_SHOW_PROJECT_INFO"), proj_open);
GeneralWxUtils::CheckMenuItem(mb, XRCID("ID_SELECT_WITH_RECT"), true);
GeneralWxUtils::CheckMenuItem(mb, XRCID("ID_SELECT_WITH_CIRCLE"), false);
GeneralWxUtils::CheckMenuItem(mb, XRCID("ID_SELECT_WITH_LINE"), false);
GeneralWxUtils::CheckMenuItem(mb, XRCID("ID_SELECT_WITH_CUSTOM"), false);
EnableTool(XRCID("ID_TOOLS_MENU"), proj_open);
EnableTool(XRCID("ID_TOOLS_WEIGHTS_MANAGER"), proj_open);
EnableTool(XRCID("ID_TOOLS_WEIGHTS_CREATE"), proj_open);
EnableTool(XRCID("ID_CONNECTIVITY_HIST_VIEW"), proj_open);
EnableTool(XRCID("ID_CONNECTIVITY_MAP_VIEW"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, _("Tools"), XRCID("ID_SHAPE_DISSOLVE"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, _("Tools"), XRCID("ID_TABLE_SPATIAL_JOIN"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, _("Tools"), XRCID("ID_TOOLS_WEIGHTS_MANAGER"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, _("Tools"), XRCID("ID_TOOLS_WEIGHTS_CREATE"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, _("Tools"), XRCID("ID_CONNECTIVITY_HIST_VIEW"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, _("Tools"), XRCID("ID_CONNECTIVITY_MAP_VIEW"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, _("Tools"), XRCID("ID_POINTS_FROM_TABLE"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_COPY_IMAGE_TO_CLIPBOARD"), false);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_SELECTION_MODE"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_SELECT_WITH_RECT"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_SELECT_WITH_CIRCLE"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_SELECT_WITH_LINE"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_SELECT_WITH_CUSTOM"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_SELECTION_MODE"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_FIT_TO_WINDOW_MODE"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_FIXED_ASPECT_RATIO_MODE"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_ADJUST_AXIS_PRECISION"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_ZOOM_MODE"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_PAN_MODE"), proj_open);
GeneralWxUtils::EnableMenuAll(mb, _("Explore"), proj_open);
EnableTool(XRCID("IDM_BOX"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_BOX"), proj_open);
EnableTool(XRCID("IDM_HIST"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_HIST"), proj_open);
EnableTool(XRCID("IDM_SCATTERPLOT"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_SCATTERPLOT"), proj_open);
EnableTool(XRCID("IDM_BUBBLECHART"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_BUBBLECHART"), proj_open);
EnableTool(XRCID("IDM_SCATTERPLOT_MAT"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_SCATTERPLOT_MAT"), proj_open);
EnableTool(XRCID("IDM_COV_SCATTERPLOT"), shp_proj);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_COV_SCATTERPLOT"), shp_proj);
EnableTool(XRCID("IDM_PCP"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_PCP"), proj_open);
EnableTool(XRCID("ID_COND_PLOT_CHOICES"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_COND_MENU"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_SHOW_CONDITIONAL_MAP_VIEW"), shp_proj);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_SHOW_CONDITIONAL_HIST_VIEW"), proj_open);
GeneralWxUtils::EnableMenuItem(mb,XRCID("ID_SHOW_CONDITIONAL_SCATTER_VIEW"), proj_open);
GeneralWxUtils::EnableMenuItem(mb,XRCID("ID_SHOW_CONDITIONAL_BOX_VIEW"), proj_open);
EnableTool(XRCID("ID_CLUSTERING_CHOICES"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_CLUSTERING_MENU"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_TOOLS_DATA_PCA"), shp_proj);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_TOOLS_DATA_KMEANS"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_TOOLS_DATA_KMEDIANS"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_TOOLS_DATA_KMEDOIDS"), proj_open);
GeneralWxUtils::EnableMenuItem(mb,XRCID("ID_TOOLS_DATA_HCLUSTER"), proj_open);
GeneralWxUtils::EnableMenuItem(mb,XRCID("ID_TOOLS_DATA_DBSCAN"), proj_open);
GeneralWxUtils::EnableMenuItem(mb,XRCID("ID_TOOLS_DATA_HDBSCAN"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_TOOLS_DATA_MAXP"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_TOOLS_DATA_SKATER"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_TOOLS_DATA_SCHC"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_TOOLS_DATA_SPECTRAL"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_TOOLS_DATA_REDCAP"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_TOOLS_DATA_MDS"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_TOOLS_DATA_TSNE"), proj_open);
EnableTool(XRCID("IDM_3DP"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_3DP"), proj_open);
EnableTool(XRCID("IDM_LINE_CHART"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_LINE_CHART"), proj_open);
EnableTool(XRCID("IDM_NEW_TABLE"), proj_open);
GeneralWxUtils::EnableMenuAll(mb, _("Table"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_SHOW_TIME_CHOOSER"),time_variant);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_CALCULATOR"), true);
EnableTool(XRCID("ID_SHOW_TIME_CHOOSER"), time_variant);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_SHOW_DATA_MOVIE"), proj_open);
EnableTool(XRCID("ID_SHOW_DATA_MOVIE"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_SHOW_CAT_CLASSIF"), proj_open);
EnableTool(XRCID("ID_SHOW_CAT_CLASSIF"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_VAR_GROUPING_EDITOR"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_TIME_EDITOR"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_EXPORT_TO_CSV_FILE"), proj_open);
EnableTool(XRCID("ID_MORAN_MENU"), proj_open);
EnableTool(XRCID("ID_LISA_MENU"), shp_proj);
EnableTool(XRCID("IDM_GETIS_ORD_MENU"), shp_proj);
EnableTool(XRCID("IDM_MSPL"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_MSPL"), proj_open);
EnableTool(XRCID("IDM_GMORAN"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_GMORAN"), proj_open);
EnableTool(XRCID("IDM_DMORAN"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_DMORAN"), proj_open);
EnableTool(XRCID("IDM_MORAN_EBRATE"), proj_open);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_MORAN_EBRATE"), proj_open);
EnableTool(XRCID("IDM_UNI_LISA"), shp_proj);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_UNI_LISA"), shp_proj);
EnableTool(XRCID("IDM_UNI_MEDIAN_LISA"), shp_proj);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_UNI_MEDIAN_LISA"), shp_proj);
EnableTool(XRCID("IDM_MULTI_LISA"), shp_proj);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_MULTI_LISA"), shp_proj);
EnableTool(XRCID("IDM_DIFF_LISA"), shp_proj);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_DIFF_LISA"), shp_proj);
EnableTool(XRCID("IDM_LISA_EBRATE"), shp_proj);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_LISA_EBRATE"), shp_proj);
EnableTool(XRCID("IDM_LOCAL_G"), shp_proj);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_LOCAL_G"), shp_proj);
EnableTool(XRCID("IDM_LOCAL_G_STAR"), shp_proj);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_LOCAL_G_STAR"), shp_proj);
EnableTool(XRCID("IDM_LOCAL_JOINT_COUNT"), shp_proj);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_LOCAL_JOINT_COUNT"), shp_proj);
EnableTool(XRCID("IDM_BIV_LJC"), shp_proj);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_BIV_LJC"), shp_proj);
EnableTool(XRCID("IDM_MUL_LJC"), shp_proj);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_MUL_LJC"), shp_proj);
EnableTool(XRCID("IDM_UNI_LOCAL_GEARY"), shp_proj);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_UNI_LOCAL_GEARY"), shp_proj);
EnableTool(XRCID("IDM_MUL_LOCAL_GEARY"), shp_proj);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_MUL_LOCAL_GEARY"), shp_proj);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_UNI_QUANTILE_LISA"), shp_proj);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_MUL_QUANTILE_LISA"), shp_proj);
EnableTool(XRCID("IDM_UNI_LOCAL_MATCH"), shp_proj);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_UNI_LOCAL_MATCH"), shp_proj);
EnableTool(XRCID("ID_CORRELO_MENU"), shp_proj);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_CORRELOGRAM"), shp_proj);
GeneralWxUtils::EnableMenuItem(mb, XRCID("IDM_DISTANCE_PLOT"), shp_proj);
GeneralWxUtils::EnableMenuAll(mb, _("Map"), shp_proj);
EnableTool(XRCID("ID_MAP_CHOICES"), shp_proj);
EnableTool(XRCID("ID_DATA_MOVIE"), shp_proj);
EnableTool(XRCID("ID_SHOW_CONDITIONAL_MAP_VIEW"), shp_proj);
EnableTool(XRCID("ID_SHOW_CARTOGRAM_NEW_VIEW"), shp_proj);
GeneralWxUtils::EnableMenuItem(mb, XRCID("ID_REGRESSION_CLASSIC"), proj_open);
EnableTool(XRCID("ID_REGRESSION_CLASSIC"), proj_open);
//Empty out the Options menu:
wxMenu* optMenu=wxXmlResource::Get()->LoadMenu("ID_DEFAULT_MENU_OPTIONS");
GeneralWxUtils::ReplaceMenu(mb, _("Options"), optMenu);
//Empty Custom category menu:
wxMenuItem* mi = mb->FindItem(XRCID("ID_OPEN_CUSTOM_BREAKS_SUBMENU"));
wxMenu* sm = mi->GetSubMenu();
if (sm) {
// clean
wxMenuItemList items = sm->GetMenuItems();
for (int i=0; i<items.size(); i++) {
sm->Delete(items[i]);
}
if (project_p) {
vector<wxString> titles;
CatClassifManager* ccm = project_p->GetCatClassifManager();
ccm->GetTitles(titles);
sm->Append(XRCID("ID_NEW_CUSTOM_CAT_CLASSIF_A"),
_("Create New Custom"),
_("Create new custom categories classification."));
sm->AppendSeparator();
for (size_t j=0; j<titles.size(); j++) {
wxMenuItem* new_mi = sm->Append(GdaConst::ID_CUSTOM_CAT_CLASSIF_CHOICE_A0+j, titles[j]);
}
GdaFrame::GetGdaFrame()->Bind(wxEVT_COMMAND_MENU_SELECTED,
&GdaFrame::OnEmptyCustomCategoryClick,
GdaFrame::GetGdaFrame(),
GdaConst::ID_CUSTOM_CAT_CLASSIF_CHOICE_A0,
GdaConst::ID_CUSTOM_CAT_CLASSIF_CHOICE_A0 + titles.size());
}
}
// Reset encoding
if (proj_open == false) SetEncodingCheckmarks(wxFONTENCODING_UTF8);
}
void GdaFrame::SetMenusToDefault()
{
// This method disables all menu items that are not
// in one of File, Tools, Methods, or Help menus.
wxMenuBar* mb = GetMenuBar();
if (!mb) return;
wxString menuText = wxEmptyString;
int menuCnt = mb->GetMenuCount();
for (int i=0; i<menuCnt; i++) {
mb->GetMenu(i);
menuText = mb->GetMenuLabelText(i);
if ( (menuText != _("File")) &&
(menuText != _("Tools")) &&
(menuText != _("Table")) &&
(menuText != _("Help")) ) {
GeneralWxUtils::EnableMenuAll(mb, menuText, false);
}
}
}
GdaFrame::GdaFrame(const wxString& title, const wxPoint& pos,
const wxSize& size, long style)
: wxFrame(NULL, wxID_ANY, title, pos, size, style)
{
SetBackgroundColour(*wxWHITE);
SetIcon(wxIcon(GeoDaIcon_16x16_xpm));
SetMenuBar(wxXmlResource::Get()->LoadMenuBar("ID_SHARED_MAIN_MENU"));
if (!GetHtmlMenuItems() || htmlMenuItems.size() == 0) {
} else {
wxMenuBar* mb = GetMenuBar();
int exp_menu_ind = mb->FindMenu(_("Explore"));
wxMenu* exp_menu = mb->GetMenu(exp_menu_ind);
wxMenu* html_menu = new wxMenu();
int base_id = GdaConst::ID_HTML_MENU_ENTRY_CHOICE_0;
for (size_t i=0; i<htmlMenuItems.size(); ++i) {
html_menu->Append(base_id++, htmlMenuItems[i].menu_title);
}
}
wxObject* tb_obj = wxXmlResource::Get()->LoadObject(this, "ToolBar", "wxAuiToolBar");
wxAuiToolBar* tb1 = (wxAuiToolBar*)tb_obj;
tb1->SetMargins(10,10);
tb1->SetMinSize(GetMinSize());
tb1->Realize();
tb1->Connect(wxEVT_SIZE, wxSizeEventHandler(GdaFrame::OnSize), NULL, this);
toolbar_list.push_front(tb1);
gda_frame = this;
SetMenusToDefault();
UpdateToolbarAndMenus();
SetEncodingCheckmarks(wxFONTENCODING_UTF8);
//CallAfter(&GdaFrame::ShowOpenDatasourceDlg,wxPoint(80, 220),true);
// check update in a new thread
if (GdaConst::disable_auto_upgrade == false) {
CallAfter(&GdaFrame::CheckUpdate);
}
}
GdaFrame::~GdaFrame()
{
GdaFrame::gda_frame = 0;
}
void GdaFrame::CheckUpdate()
{
wxLogMessage("Check auto update:");
wxString version = AutoUpdate::CheckUpdate();
if (!version.IsEmpty()) {
wxLogMessage("current version:");
wxLogMessage(version);
wxString skip_version;
std::vector<wxString> items = OGRDataAdapter::GetInstance().GetHistory("no_update_version");
if (items.size()>0)
skip_version = items[0];
if (skip_version == version)
return;
bool showSkip = true;
AutoUpdateDlg updateDlg(NULL, showSkip);
if (updateDlg.ShowModal() == wxID_NO) {
OGRDataAdapter::GetInstance().AddEntry("no_update_version", version);
}
}
}
void GdaFrame::OnSize(wxSizeEvent& event)
{
BOOST_FOREACH( wxAuiToolBar* tb, toolbar_list ) {
if (tb) {
tb->SetOverflowVisible(!tb->GetToolFitsByIndex(tb->GetToolCount()-1));
tb->Refresh();
}
}
event.Skip();
}
void GdaFrame::EnableTool(int xrc_id, bool enable)
{
BOOST_FOREACH( wxAuiToolBar* tb, toolbar_list ) {
if (tb) {
tb->EnableTool(xrc_id, enable);
tb->Refresh();
}
}
}
void GdaFrame::EnableTool(const wxString& id_str, bool enable)
{
BOOST_FOREACH( wxAuiToolBar* tb, toolbar_list ) {
if (tb)
tb->EnableTool(wxXmlResource::GetXRCID(id_str), enable);
}
}
bool GdaFrame::IsProjectOpen()
{
return projectOpen;
}
void GdaFrame::SetProjectOpen(bool open)
{
projectOpen = open;
}
boost::uuids::uuid GdaFrame::GetWeightsId(const wxString& caption)
{
SelectWeightsDlg dlg(project_p, this, caption);
if (dlg.ShowModal()!= wxID_OK) return boost::uuids::nil_uuid();
project_p->GetWManInt()->MakeDefault(dlg.GetSelWeightsId());
return dlg.GetSelWeightsId();
}
void GdaFrame::OnOpenNewTable()
{
TableFrame* tf = 0;
wxGrid* g = project_p->FindTableGrid();
if (g) tf = (TableFrame*) g->GetParent()->GetParent(); // wxPanel<wxFrame
if (!tf) {
wxString msg = _("The Table should always be open, although somtimes it is hidden while the project is open. This condition has been violated. Please report this to the program developers.");
wxMessageDialog dlg(this, msg, _("Warning"), wxOK | wxICON_WARNING);
dlg.ShowModal();
tf = new TableFrame(gda_frame, project_p,
GdaConst::table_frame_title,
wxDefaultPosition,
GdaConst::table_default_size,
wxDEFAULT_FRAME_STYLE);
}
tf->Show(true);
tf->Maximize(false);
tf->Raise();
}
/** returns false if user wants to abort the operation */
bool GdaFrame::OnCloseProject(bool ignore_unsaved_changes)
{
if (IsProjectOpen() && !ignore_unsaved_changes) {
bool is_new_project = project_p->GetProjectFullPath().empty() || !wxFileExists(project_p->GetProjectFullPath());
bool unsaved_meta_data = project_p->GetTableInt()->ProjectChangedSinceLastSave();
bool unsaved_ds_data = project_p->GetTableInt()->ChangedSinceLastSave();
wxString msg;
wxString title;
if (unsaved_ds_data || unsaved_meta_data) {
title = _("Do you want to save your data?");
msg << "\n";
msg << _("There are unsaved data source or weights/time definition changes.");
wxMessageDialog msgDlg(this, msg, title,
wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION );
if (msgDlg.ShowModal() == wxID_YES) {
if (project_p) {
if (unsaved_ds_data) {
try {
project_p->SaveDataSourceData();
try {
project_p->SaveProjectConf();
} catch( GdaException& e) {
// do nothing if save project configuration failed, since it's not critical
}
} catch (GdaException& e) {
// the title of the message dialog is empty, because
// the message could be an "eror" message or an "info" message
// e.g. "Saving data source cancelled"
wxMessageDialog dlg (this, e.what(), "", wxOK | wxICON_ERROR);
dlg.ShowModal();
}
}
}
}
}
if (project_p->IsDataTypeChanged()) {
wxString msg = _("Geometries have been added to existing Table-only data source. Do you want to save them as a new datasource?");
wxMessageDialog show_export_dlg(this, msg, _("Geometries not saved"),
wxYES_NO|wxYES_DEFAULT|wxICON_QUESTION);
if (show_export_dlg.ShowModal() == wxID_YES) {
// e.g. dbf, add geometries (points), to shapefile
ExportDataDlg dlg(this, project_p);
dlg.ShowModal();
}
}
}
SetProjectOpen(false);
if (project_p) {
if (project_p->GetTableState()) {
project_p->GetTableState()->closeAndDeleteWhenEmpty();
}
if (project_p->GetTimeState()) {
project_p->GetTimeState()->closeAndDeleteWhenEmpty();
}
if (project_p->GetWManState()) {
project_p->GetWManState()->closeAndDeleteWhenEmpty();
}
if (project_p->GetFramesManager()) {
project_p->GetFramesManager()->closeAndDeleteWhenEmpty();
std::list<FramesManagerObserver*> observers(project_p->GetFramesManager()->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
FramesManagerObserver* fmo = *it;
wxTopLevelWindow* w = dynamic_cast<wxTopLevelWindow*>(fmo);
if (w) {
wxString msg="Calling Close(true) for wxTopLevelWindow: ";
msg << w->GetTitle();
w->Close(true);
w->Destroy();
}
}
}
if (project_p->GetHighlightState()) {
project_p->GetHighlightState()->closeAndDeleteWhenEmpty();
}
if (project_p->GetConMapHlightState()) {
project_p->GetConMapHlightState()->closeAndDeleteWhenEmpty();
}
project_p->CleanupPairsHLState();
}
if (project_p) delete project_p; project_p = 0;
// notify wxTopLevelWindows not managed by Project
wxWindowList::compatibility_iterator node = wxTopLevelWindows.GetFirst();
while (node) {
wxWindow* win = node->GetData();
if (CalculatorDlg* w = dynamic_cast<CalculatorDlg*>(win)) {
w->DisconnectFromProject();
}
if (CreateGridDlg* w = dynamic_cast<CreateGridDlg*>(win)) {
w->Close(true);
}
node = node->GetNext();
}
UpdateToolbarAndMenus();
MapCanvas::ResetThumbnail();
return true;
}
void GdaFrame::OnClose(wxCloseEvent& event)
{
wxLogMessage("Click GdaFrame::OnClose");
if (IsProjectOpen()) {
wxString prj_full_path = project_p->GetProjectFullPath();
bool is_new_project = prj_full_path.empty() || (wxFileExists(prj_full_path)==false);
bool unsaved_meta_data = project_p->GetTableInt()->ProjectChangedSinceLastSave();
bool unsaved_ds_data = project_p->GetTableInt()->ChangedSinceLastSave();
wxString msg;
wxString title;
if (unsaved_ds_data || unsaved_meta_data) {
title = _("Exit with unsaved changes?");
msg << "\n";
msg << _("There are unsaved data source or weights/time definition changes.");
} else {
title = _("Exit?");
msg = _("OK to Exit?");
}
wxMessageDialog msgDlg(this, msg, title,
wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION);
// Show the message dialog, and if it returns wxID_YES...
if (msgDlg.ShowModal() != wxID_YES) {
event.Veto();
return;
}
OnCloseProject(true);
}
// Close windows not associated managed by Project
wxWindowList::compatibility_iterator node = wxTopLevelWindows.GetFirst();
while (node) {
wxWindow* win = node->GetData();
if (CalculatorDlg* w = dynamic_cast<CalculatorDlg*>(win)) {
w->Close(true);
}
if (CreateGridDlg* w = dynamic_cast<CreateGridDlg*>(win)) {
w->Close(true);
}
node = node->GetNext();
}
// close GeoDa successfully, mark it
OGRDataAdapter::GetInstance().AddEntry("NoCrash", "true");
wxMilliSleep(100);
Destroy();
}
void GdaFrame::OnMenuClose(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnMenuClose");
Close(); // This will result in a call to OnClose
}
void GdaFrame::OnCloseProjectEvt(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnCloseProjectEvt");
OnCloseProject();
}
void GdaFrame::UpdateRecentDatasourceMenu()
{
try {
// update recent opened datasource menu
RecentDatasource recent_ds;
std::vector<wxString> recent_ds_list = recent_ds.GetList();
int recent_menu_xrcid = XRCID("ID_NEW_PROJ_FROM_RECENT_MENU");
wxMenuBar* mb = GetMenuBar();
if (mb == NULL)
return;
wxMenuItem* mi = mb->FindItem(recent_menu_xrcid);
if (mi == NULL)
return;
wxMenu* recent_menu = mi->GetSubMenu();
if (recent_menu == NULL)
return;
int n_recent_menuitems = recent_menu->GetMenuItemCount();
for (int i=n_recent_menuitems-1; i >=0; i--) {
wxMenuItem* recent_item = recent_menu->FindItemByPosition(i);
recent_menu->Destroy(recent_item);
}
for (size_t i=0; i<recent_ds_list.size(); i++ ) {
if (recent_ds_list[i].IsEmpty()) continue;
wxMenuItem* recent_item = recent_menu->Append(wxID_ANY,
recent_ds_list[i]);
int xrc_id = recent_item->GetId();
Connect(xrc_id, wxEVT_COMMAND_TOOL_CLICKED,
wxCommandEventHandler(GdaFrame::OnRecentDSClick));
}
} catch(GdaException ex) {
// do nothing but write to LOG
}
}
void GdaFrame::RemoveInvalidRecentDS()
{
RecentDatasource recent_ds;
recent_ds.DeleteLastRecord();
}
void GdaFrame::OnCustomCategoryClick(wxCommandEvent& event)
{
int xrc_id = event.GetId();
if (project_p) {
CatClassifManager* ccm = project_p->GetCatClassifManager();
if (!ccm) return;
vector<wxString> titles;
ccm->GetTitles(titles);
int idx = xrc_id - GdaConst::ID_CUSTOM_CAT_CLASSIF_CHOICE_A0;
if (idx < 0 || idx >= titles.size()) return;
wxString cc_title = titles[idx];
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) {
// if there is no active map window, pop to create new map window
OnEmptyCustomCategoryClick(event);
return;
}
if (CartogramNewFrame* f = dynamic_cast<CartogramNewFrame*>(t)) {
f->OnCustomCatClassifA(cc_title);
} else if (ConditionalMapFrame* f = dynamic_cast<ConditionalMapFrame*>(t)) {
f->OnCustomCatClassifA(cc_title);
} else if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnCustomCatClassifA(cc_title);
} else if (PCPFrame* f = dynamic_cast<PCPFrame*>(t)) {
f->OnCustomCatClassifA(cc_title);
} else if (CartogramNewFrame* f = dynamic_cast<CartogramNewFrame*>(t)) {
f->OnCustomCatClassifA(cc_title);
} else if (ScatterNewPlotFrame* f = dynamic_cast<ScatterNewPlotFrame*>(t)) {
f->OnCustomCatClassifA(cc_title);
} else {
// if there is no active map window, pop to create new map window
OnEmptyCustomCategoryClick(event);
}
}
}
void GdaFrame::OnEmptyCustomCategoryClick(wxCommandEvent& event)
{
int xrc_id = event.GetId();
if (project_p) {
CatClassifManager* ccm = project_p->GetCatClassifManager();
if (!ccm) return;
vector<wxString> titles;
ccm->GetTitles(titles);
int idx = xrc_id - GdaConst::ID_CUSTOM_CAT_CLASSIF_CHOICE_A0;
if (idx < 0 || idx >= titles.size()) return;
wxString cc_title = titles[idx];
CatClassifState* cc_state = ccm->FindClassifState(cc_title);
CatClassifDef& cc_def = cc_state->GetCatClassif();
wxString fld_name = cc_def.assoc_db_fld_name;
project_p->SetDefaultVarName(0, fld_name);
VariableSettingsDlg dlg(project_p, VariableSettingsDlg::univariate);
if (dlg.ShowModal() != wxID_OK) return;
MapFrame* nf = new MapFrame(GdaFrame::gda_frame, project_p,
dlg.var_info, dlg.col_ids,
CatClassification::no_theme,
MapCanvas::no_smoothing, 1,
boost::uuids::nil_uuid(),
wxDefaultPosition,
GdaConst::map_default_size);
nf->ChangeMapType(CatClassification::custom, MapCanvas::no_smoothing, 4, boost::uuids::nil_uuid(), true, dlg.var_info, dlg.col_ids, cc_title);
nf->UpdateTitle();
}
}
void GdaFrame::OnRecentDSClick(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnRecentDSClick");
if (project_p)
return;
int xrc_id = event.GetId();
wxMenuBar* mb = GetMenuBar();
if (mb == NULL)
return;
wxMenuItem* mi = mb->FindItem(xrc_id);
if (mi == NULL)
return;
wxString ds_name = mi->GetItemLabelText();
if (ds_name.IsEmpty())
return;
wxLogMessage(ds_name);
if (ds_name.EndsWith(".gda")) {
OpenProject(ds_name);
return;
}
RecentDatasource recent_ds;
IDataSource* ds = recent_ds.GetDatasource(ds_name);
if (ds == NULL) {
// raise message dialog show can't connect to datasource
wxString msg = _("Can't connect to datasource: ") + ds_name;
wxMessageDialog dlg (this, msg, _("Error"), wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
}
wxString layername = recent_ds.GetLayerName(ds_name);
if (layername.IsEmpty())
return;
try {
wxString proj_title = layername;
project_p = new Project(proj_title, layername, ds);
} catch (GdaException& e) {
RemoveInvalidRecentDS();
wxMessageDialog dlg (this, e.what(), _("Error"), wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
}
InitWithProject();
}
/** New Project opened by the user from outside the program, for example
when a user double clicks on a datasource type associated with GeoDa, or
when a user right clicks on a file and chooses "Open with GeoDa." Can
also be called from the shortcut "New Project From" File menu option. */
void GdaFrame::NewProjectFromFile(const wxString& full_file_path)
{
wxString proj_title = wxFileName(full_file_path).GetName();
wxString layer_name = proj_title;
try {
FileDataSource fds(full_file_path);
// this datasource will be freed when dlg exit, so make a copy
// in project_p
project_p = new Project(proj_title, layer_name, &fds);
} catch (GdaException& e) {
RemoveInvalidRecentDS();
wxMessageDialog dlg (this, e.what(), _("Error"), wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
}
wxString error_msg;
if (!project_p) {
error_msg << "Error: Could not initialize new project.";
} else if (!project_p->IsValid()) {
error_msg << "Error:";
error_msg << project_p->GetOpenErrorMessage();
}
if (!error_msg.IsEmpty()) {
wxMessageDialog dlg (this, error_msg, _("Error"), wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
}
InitWithProject();
}
/** New Project opened by the user from within GeoDa */
void GdaFrame::OnNewProject(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnNewProject");
ShowOpenDatasourceDlg(wxPoint(80, 220));
}
void GdaFrame::ShowOpenDatasourceDlg(wxPoint pos, bool init)
{
if (init && project_p) {
return;
}
ConnectDatasourceDlg dlg(this, pos);
if (dlg.ShowModal() != wxID_OK) {
// when open a gda file, which already handles in
// ConnectDatasoureDlg()
// and the dlg will return wxID_CANCLE
return;
}
wxString proj_title = dlg.GetProjectTitle();
wxString layer_name = dlg.GetLayerName();
IDataSource* datasource = dlg.GetDataSource();
try {
// this datasource will be freed when dlg exit, so make a copy
// in project_p
project_p = new Project(proj_title, layer_name, datasource);
if (!project_p->IsValid()) {
// do noting
return;
}
} catch (GdaException& e) {
RemoveInvalidRecentDS();
wxMessageDialog dlg (this, e.what(), _("Error"), wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
}
wxString error_msg;
if (!project_p) {
error_msg << _("Could not initialize new project.");
} else if (!project_p->IsValid()) {
error_msg << _("Could not initialize new project.");
error_msg << project_p->GetOpenErrorMessage();
}
if (!error_msg.IsEmpty()) {
delete project_p;
project_p = NULL;
wxMessageDialog dlg (this, error_msg, _("Error"), wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
}
InitWithProject();
}
/**
OpenProject can be called while another project file is currently open. This
can happen currently on Mac OSX when the user double-clicks on multiple
project files. At present, we will simply present a message to the user
saying that the current project must be closed first. In the future,
especially when multiple layers are supported, we could do something
fancier.
*/
void GdaFrame::OpenProject(const wxString& full_proj_path)
{
wxLogMessage("GdaFrame::OpenProject()");
wxLogMessage(full_proj_path);
wxString msg;
wxFileName fn(full_proj_path);
if (fn.GetExt().CmpNoCase("gda") != 0) {
// open from a raw file/ds
if (IsProjectOpen()) {
Raise();
msg = _("You have requested to create a new file project %s while another project is open. Please close project %s and try again.");
msg = wxString::Format(msg, full_proj_path, project_p->GetProjectTitle());
return;
}
NewProjectFromFile(full_proj_path);
return;
}
if (!wxFileExists(full_proj_path)) {
msg = _("Error: \"%s\" not found.");
msg = wxString::Format(msg, full_proj_path);
}
if (!msg.IsEmpty()) {
LOG_MSG(msg);
wxMessageDialog dlg (this, msg, _("Error"), wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
}
// if requested project to open is already open, just raise current window
if (IsProjectOpen()) {
if (project_p->GetProjectFullPath().CmpNoCase(full_proj_path) == 0) {
Raise();
return;
}
Raise();
wxString msg;
msg = _("You have requested to create a new file project %s while another project is open. Please close project %s and try again.");
msg = wxString::Format(msg, full_proj_path, project_p->GetProjectTitle());
wxMessageDialog dlg (this, msg, _("Error"), wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
}
if (project_p) {
// close any existing windows and project
FramesManager* fm = project_p->GetFramesManager();
if (fm && fm->getNumberObservers() > 0)
if(!OnCloseProject())
return;
}
try {
project_p = new Project(full_proj_path);
if (!project_p->IsValid()) {
RemoveInvalidRecentDS();
wxString msg = _("Error while opening project:\n\n");
msg << project_p->GetOpenErrorMessage();
throw GdaException(msg.c_str());
}
} catch (GdaException &e) {
wxString msg( e.what(), wxConvUTF8 ) ;
wxMessageDialog dlg (this, msg, _("Error"), wxOK | wxICON_ERROR);
dlg.ShowModal();
delete project_p;
project_p = 0;
return;
}
InitWithProject(full_proj_path);
}
void GdaFrame::OnOpenProject(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnOpenProject");
if (project_p && project_p->GetFramesManager()->getNumberObservers() > 0) {
if (!OnCloseProject())
return;
}
wxString wildcard = "GeoDa Project (*.gda)|*.gda";
wxFileDialog dlg(this, _("GeoDa Project File to Open"), "", "", wildcard);
if (dlg.ShowModal() != wxID_OK)
return;
OpenProject(dlg.GetPath());
}
void GdaFrame::InitWithProject(wxString gda_file_path)
{
wxLogMessage("Click GdaFrame::InitWithProject()");
// By this point, we know that project has created as
// TopFrameManager object with delete_if_empty = false
RecentDatasource recent_ds;
if (gda_file_path.IsEmpty()) {
recent_ds.Add(project_p->GetDataSource(), project_p->GetProjectTitle());
} else {
recent_ds.Add(gda_file_path, gda_file_path, project_p->GetProjectTitle());
}
// This call is very improtant because we need the wxGrid to
// take ownership of the TableBase instance (due to bug in wxWidgets)
TableFrame* tf = new TableFrame(this, project_p, _("Table"),
wxDefaultPosition,
GdaConst::table_default_size,
wxDEFAULT_FRAME_STYLE);
if (project_p->IsTableOnlyProject()) {
tf->Show(true);
tf->Raise();
}
if (!project_p->IsTableOnlyProject()) {
std::vector<int> col_ids;
std::vector<GdaVarTools::VarInfo> var_info;
WeightsManInterface* w_int = project_p->GetWManInt();
boost::uuids::uuid w_id = boost::uuids::nil_uuid();
if (w_int) {
w_id = w_int->GetDefault();
}
MapFrame* nf = new MapFrame(GdaFrame::gda_frame, project_p,
var_info, col_ids,
CatClassification::no_theme,
MapCanvas::no_smoothing, 1,
w_id,
wxPoint(80,160),
GdaConst::map_default_size);
nf->UpdateTitle();
}
SetProjectOpen(true);
UpdateToolbarAndMenus();
// Associate Project with Calculator if open
wxWindowList::compatibility_iterator node = wxTopLevelWindows.GetFirst();
while (node) {
wxWindow* win = node->GetData();
if (CalculatorDlg* w = dynamic_cast<CalculatorDlg*>(win)) {
w->ConnectToProject(GetProject());
}
node = node->GetNext();
}
}
void GdaFrame::OnSaveProject(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnSaveProject");
if (!project_p)
return;
try {
project_p->SaveDataSourceData();
// don't need to raise error if save project configuration failed
try {
project_p->SaveProjectConf();
} catch( GdaException& e) {
// do nothing if save project configuration failed,
// since it's not critical
}
} catch (GdaException& e) {
// the title of the message dialog is empty, because
// the message could be an "eror" message or an "info" message
// e.g. "Saving data source cancelled"
wxMessageDialog dlg (this, e.what(), "", wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
}
// here, we know Data Source data was saved successfully
SaveButtonManager* sbm = project_p->GetSaveButtonManager();
if (sbm) {
sbm->SetAllowEnableSave(true);
sbm->SetMetaDataSaveNeeded(false);
}
}
void GdaFrame::OnSaveAsProject(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnSaveAsProject");
if (!project_p || !project_p->GetTableInt())
return;
wxString proj_fname = project_p->GetProjectFullPath();
bool is_new_project = (proj_fname.empty() || !wxFileExists(proj_fname));
if (is_new_project) {
wxString msg = _("A project file contains extra information not directly stored in the data source such as variable order and grouping.");
wxMessageDialog proj_create_dlg(this, msg, _("Create Project File Now?"),
wxYES_NO|wxYES_DEFAULT|wxICON_QUESTION);
if (proj_create_dlg.ShowModal() != wxID_YES) return;
wxString wildcard = _("GeoDa Project (*.gda)|*.gda");
wxFileDialog dlg(this, _("New Project Filename"), "", "",
wildcard, wxFD_SAVE);
if (dlg.ShowModal() != wxID_OK) return;
try {
proj_fname = dlg.GetPath();
project_p->SpecifyProjectConfFile(proj_fname);
} catch (GdaException& e) {
wxMessageDialog dlg (this, e.what(), _("Error"), wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
}
}
try {
project_p->SaveProjectConf();
wxString msg = _("Saved successfully.");
wxMessageDialog dlg(this, msg , _("Info"), wxOK | wxICON_INFORMATION);
dlg.ShowModal();
} catch (GdaException& e) {
wxMessageDialog dlg (this, e.what(), _("Error"), wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
}
wxLogMessage(_("Wrote GeoDa Project File: ") + proj_fname);
}
void GdaFrame::OnSelectWithRect(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnSelectWithRect");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ScatterPlotMatFrame* f = dynamic_cast<ScatterPlotMatFrame*>(t)) {
wxLogMessage("ScatterPlotMatFrame::OnSelectWithRect");
f->OnSelectWithRect(event);
} else {
t->OnSelectWithRect(event);
}
}
void GdaFrame::OnSelectWithCircle(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnSelectWithCircle");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
t->OnSelectWithCircle(event);
}
void GdaFrame::OnSelectWithLine(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnSelectWithLine");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
t->OnSelectWithLine(event);
}
void GdaFrame::OnSelectWithCustom(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnSelectWithCustom");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
t->OnSelectWithCustom(event);
}
void GdaFrame::OnSelectionMode(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnSelectionMode");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
t->OnSelectionMode(event);
}
void GdaFrame::OnFitToWindowMode(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnFitToWindowMode");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
t->OnFitToWindowMode(event);
}
void GdaFrame::OnFixedAspectRatioMode(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnFixedAspectRatioMode");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (t) t->OnFixedAspectRatioMode(event);
}
void GdaFrame::OnSetAxisDisplayPrecision(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnSetDisplayPrecision");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (t) t->OnSetAxisDisplayPrecision(event);
}
void GdaFrame::OnZoomMode(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnZoomMode");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (t) t->OnZoomMode(event);
}
void GdaFrame::OnPanMode(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnPanMode");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
t->OnPanMode(event);
}
void GdaFrame::OnPrintCanvasState(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnPrintCanvasState");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (t) t->OnPrintCanvasState(event);
// Add this menu item to the XRC file to see this debugging option:
//<object class="wxMenuItem" name="ID_PRINT_CANVAS_STATE">
// <label>Print Canvas State to Log File</label>
//</object>s
}
void GdaFrame::OnChangeMapTransparency(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnChangeMapTransparency");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t)
return;
MapFrame* f = dynamic_cast<MapFrame*>(t);
if (f)
f->OnChangeMapTransparency();
}
void GdaFrame::OnCleanBasemap(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnCleanBasemap");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (t) {
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) return
f->CleanBasemap();
}
}
void GdaFrame::OnSetNoBasemap(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnSetNoBasemap");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
MapFrame* f = dynamic_cast<MapFrame*>(t);
if (f) f->SetNoBasemap();
}
void GdaFrame::OnBasemapConfig(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnBasemapConfig");
BasemapConfDlg dlg(this,project_p);
dlg.ShowModal();
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (t) t->OnRefreshMap(event);
}
void GdaFrame::OnSaveCanvasImageAs(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnSaveCanvasImageAs");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (t) t->OnSaveCanvasImageAs(event);
}
void GdaFrame::OnQuit(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnQuit");
// Generate a wxCloseEvent for GdaFrame. GdaFrame::OnClose will
// be called and will give the user a chance to not exit program.
// Close windows not associated managed by Project
Close();
event.Skip(false);
}
void GdaFrame::OnSaveSelectedToColumn(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnSaveSelectedToColumn");
SaveSelectionDlg dlg(project_p, this);
dlg.ShowModal();
}
void GdaFrame::OnCanvasBackgroundColor(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnCanvasBackgroundColor");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
t->OnCanvasBackgroundColor(event);
}
void GdaFrame::OnLegendUseScientificNotation(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnLegendUseScientificNotation");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
t->OnLegendUseScientificNotation(event);
}
void GdaFrame::OnLegendDisplayPrecision(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnLegendDisplayPrecision");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
t->OnLegendDisplayPrecision(event);
}
void GdaFrame::OnLegendBackgroundColor(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnLegendBackgroundColor");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
t->OnLegendBackgroundColor(event);
}
void GdaFrame::OnSelectableFillColor(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnSelectableFillColor");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ScatterPlotMatFrame* f = dynamic_cast<ScatterPlotMatFrame*>(t)) {
f->OnSelectableFillColor(event);
} else {
t->OnSelectableFillColor(event);
}
}
void GdaFrame::OnSelectableOutlineColor(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnSelectableOutlineColor");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ScatterPlotMatFrame* f = dynamic_cast<ScatterPlotMatFrame*>(t)) {
f->OnSelectableOutlineColor(event);
} else {
t->OnSelectableOutlineColor(event);
}
}
void GdaFrame::OnSelectableOutlineVisible(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnSelectableOutlineVisible");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
t->OnSelectableOutlineVisible(event);
}
void GdaFrame::OnShowMapBoundary(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnShowMapBoundary");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnShowMapBoundary(event);
}
}
void GdaFrame::OnHighlightColor(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnHighlightColor");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ScatterPlotMatFrame* f = dynamic_cast<ScatterPlotMatFrame*>(t)) {
f->OnHighlightColor(event);
} else {
t->OnHighlightColor(event);
}
}
void GdaFrame::OnCopyImageToClipboard(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnCopyImageToClipboard");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
t->OnCopyImageToClipboard(event);
}
void GdaFrame::OnCopyLegendToClipboard(wxCommandEvent& event)
{
wxLogMessage("Click GdaFrame::OnCopyLegendToClipboard");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
t->OnCopyLegendToClipboard(event);
}
void GdaFrame::OnKeyEvent(wxKeyEvent& event)
{
Project* project = GetProject();
if (event.GetModifiers() == wxMOD_CMD &&
project && project->GetTimeState() &&
project->GetTableInt()->IsTimeVariant() &&
(event.GetKeyCode() == WXK_LEFT || event.GetKeyCode() == WXK_RIGHT)) {
int del = (event.GetKeyCode() == WXK_LEFT) ? -1 : 1;
project->GetTimeState()->SetCurrTime(
project->GetTimeState()->GetCurrTime() + del);
if (project->GetTimeState()->GetCurrTime() < 0) {
project->GetTimeState()->SetCurrTime(
project->GetTableInt()->GetTimeSteps()-1);
} else if (project->GetTimeState()->GetCurrTime()
>= project->GetTableInt()->GetTimeSteps()) {
project->GetTimeState()->SetCurrTime(0);
}
if (project->GetTimeState()) {
project->GetTimeState()->notifyObservers();
}
return;
}
event.Skip();
}
void GdaFrame::OnToolsDataPCA(wxCommandEvent& WXUNUSED(event) )
{
Project* p = GetProject();
if (!p) return;
FramesManager* fm = p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (PCASettingsDlg* w = dynamic_cast<PCASettingsDlg*>(*it)) {
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
PCASettingsDlg* dlg = new PCASettingsDlg(this, p);
dlg->Show(true);
}
void GdaFrame::OnToolsDataKMeans(wxCommandEvent& WXUNUSED(event) )
{
Project* p = GetProject();
if (!p) return;
FramesManager* fm = p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (KMeansDlg* w = dynamic_cast<KMeansDlg*>(*it)) {
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
KMeansDlg* dlg = new KMeansDlg(this, p);
dlg->Show(true);
}
void GdaFrame::OnToolsDataKMedians(wxCommandEvent& WXUNUSED(event) )
{
Project* p = GetProject();
if (!p) return;
FramesManager* fm = p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (KMediansDlg* w = dynamic_cast<KMediansDlg*>(*it)) {
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
KMediansDlg* dlg = new KMediansDlg(this, p);
dlg->Show(true);
}
void GdaFrame::OnToolsDataKMedoids(wxCommandEvent& WXUNUSED(event) )
{
Project* p = GetProject();
if (!p) return;
FramesManager* fm = p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (KMedoidsDlg* w = dynamic_cast<KMedoidsDlg*>(*it)) {
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
KMedoidsDlg* dlg = new KMedoidsDlg(this, p);
dlg->Show(true);
}
void GdaFrame::OnToolsDataMaxP(wxCommandEvent& WXUNUSED(event) )
{
Project* p = GetProject();
if (!p) return;
FramesManager* fm = p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (MaxpDlg* w = dynamic_cast<MaxpDlg*>(*it)) {
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
MaxpDlg* dlg = new MaxpDlg(this, p);
dlg->Show(true);
}
void GdaFrame::OnToolsDataAZP(wxCommandEvent& WXUNUSED(event) )
{
Project* p = GetProject();
if (!p) return;
FramesManager* fm = p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (AZPDlg* w = dynamic_cast<AZPDlg*>(*it)) {
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
AZPDlg* dlg = new AZPDlg(this, p);
dlg->Show(true);
}
void GdaFrame::OnToolsDataSkater(wxCommandEvent& WXUNUSED(event) )
{
Project* p = GetProject();
if (!p) return;
FramesManager* fm = p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (SkaterDlg* w = dynamic_cast<SkaterDlg*>(*it)) {
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
SkaterDlg* dlg = new SkaterDlg(this, p);
dlg->Show(true);
}
void GdaFrame::OnToolsDataSCHC(wxCommandEvent& WXUNUSED(event) )
{
Project* p = GetProject();
if (!p) return;
FramesManager* fm = p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (SCHCDlg* w = dynamic_cast<SCHCDlg*>(*it)) {
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
SCHCDlg* dlg = new SCHCDlg(this, p);
dlg->Show(true);
}
void GdaFrame::OnToolsDataRedcap(wxCommandEvent& WXUNUSED(event) )
{
Project* p = GetProject();
if (!p) return;
FramesManager* fm = p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (RedcapDlg* w = dynamic_cast<RedcapDlg*>(*it)) {
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
RedcapDlg* dlg = new RedcapDlg(this, p);
dlg->Show(true);
}
void GdaFrame::OnToolsDataMDS(wxCommandEvent& WXUNUSED(event) )
{
Project* p = GetProject();
if (!p) return;
FramesManager* fm = p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (MDSDlg* w = dynamic_cast<MDSDlg*>(*it)) {
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
MDSDlg* dlg = new MDSDlg(this, p);
dlg->Show(true);
}
void GdaFrame::OnToolsDataTSNE(wxCommandEvent& WXUNUSED(event) )
{
Project* p = GetProject();
if (!p) return;
FramesManager* fm = p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (TSNEDlg* w = dynamic_cast<TSNEDlg*>(*it)) {
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
TSNEDlg* dlg = new TSNEDlg(this, p);
dlg->Show(true);
}
void GdaFrame::OnToolsDataSpectral(wxCommandEvent& WXUNUSED(event) )
{
Project* p = GetProject();
if (!p) return;
FramesManager* fm = p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (SpectralClusteringDlg* w = dynamic_cast<SpectralClusteringDlg*>(*it)) {
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
SpectralClusteringDlg* dlg = new SpectralClusteringDlg(this, p);
dlg->Show(true);
}
void GdaFrame::OnToolsDataHCluster(wxCommandEvent& WXUNUSED(event) )
{
Project* p = GetProject();
if (!p) return;
FramesManager* fm = p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
HClusterDlg* w = dynamic_cast<HClusterDlg*>(*it);
SCHCDlg* w1 = dynamic_cast<SCHCDlg*>(*it);
if (w && !w1) {
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
HClusterDlg* dlg = new HClusterDlg(this, p);
dlg->Show(true);
}
void GdaFrame::OnToolsDataDBScan(wxCommandEvent& WXUNUSED(event) )
{
Project* p = GetProject();
if (!p) return;
FramesManager* fm = p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (DBScanDlg* w = dynamic_cast<DBScanDlg*>(*it)) {
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
DBScanDlg* dlg = new DBScanDlg(this, p);
dlg->Show(true);
}
void GdaFrame::OnToolsDataHDBScan(wxCommandEvent& WXUNUSED(event) )
{
Project* p = GetProject();
if (!p) return;
FramesManager* fm = p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (HDBScanDlg* w = dynamic_cast<HDBScanDlg*>(*it)) {
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
HDBScanDlg* dlg = new HDBScanDlg(this, p);
dlg->Show(true);
}
void GdaFrame::OnToolsWeightsManager(wxCommandEvent& WXUNUSED(event) )
{
wxLogMessage("Click GdaFrame::OnToolsWeightsManager");
Project* p = GetProject();
if (!p || !p->GetTableInt()) return;
FramesManager* fm = p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (WeightsManFrame* w = dynamic_cast<WeightsManFrame*>(*it)) {
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
// memory managed by wx
WeightsManFrame* f = new WeightsManFrame(this, p);
}
void GdaFrame::OnToolsWeightsCreate(wxCommandEvent& WXUNUSED(event) )
{
wxLogMessage("Click GdaFrame::OnToolsWeightsCreate");
Project* p = GetProject();
if (!p || !p->GetTableInt()) return;
FramesManager* fm = p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (CreatingWeightDlg* w = dynamic_cast<CreatingWeightDlg*>(*it)) {
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
CreatingWeightDlg* dlg = new CreatingWeightDlg(0, p);
dlg->Show(true);
}
void GdaFrame::OnConnectivityHistView(wxCommandEvent& event )
{
boost::uuids::uuid id = GetWeightsId();
if (id.is_nil()) return;
// memory managed by wx
ConnectivityHistFrame* f = new ConnectivityHistFrame(this, project_p, id);
}
void GdaFrame::OnConnectivityMapView(wxCommandEvent& event )
{
boost::uuids::uuid id = GetWeightsId("Choose Weights for Connectivity Map");
if (id.is_nil()) return;
if (project_p->isTableOnly) return;
// memory managed by wx
ConnectivityMapFrame* f =
new ConnectivityMapFrame(this, project_p, id,
wxDefaultPosition,
GdaConst::conn_map_default_size);
}
void GdaFrame::ShowConnectivityMapView(boost::uuids::uuid weights_id)
{
if (!project_p || !project_p->GetWManInt() ||
weights_id.is_nil()) return;
ConnectivityMapFrame* f =
new ConnectivityMapFrame(this, project_p, weights_id,
wxDefaultPosition,
GdaConst::conn_map_default_size);
}
void GdaFrame::OnMapChoices(wxCommandEvent& event)
{
wxLogMessage("Entering GdaFrame::OnMapChoices");
wxMenu* popupMenu = 0;
if (GeneralWxUtils::isMac()) {
popupMenu = wxXmlResource::Get()->LoadMenu("ID_MAP_CHOICES");
} else {
popupMenu = wxXmlResource::Get()->LoadMenu("ID_MAP_CHOICES_NO_ICONS");
}
if (popupMenu) {
int m_id = popupMenu->FindItem(_("Custom Breaks"));
wxMenuItem* mi = popupMenu->FindItem(m_id);
if (mi) {
wxMenu* sm = mi->GetSubMenu();
if (sm) {
// clean
wxMenuItemList items = sm->GetMenuItems();
for (int i=0; i<items.size(); i++) {
sm->Delete(items[i]);
}
vector<wxString> titles;
CatClassifManager* ccm = project_p->GetCatClassifManager();
ccm->GetTitles(titles);
sm->Append(XRCID("ID_NEW_CUSTOM_CAT_CLASSIF_A"), _("Create New Custom"), _("Create new custom categories classification."));
sm->AppendSeparator();
for (size_t j=0; j<titles.size(); j++) {
wxMenuItem* new_mi = sm->Append(GdaConst::ID_CUSTOM_CAT_CLASSIF_CHOICE_A0+j, titles[j]);
}
GdaFrame::GetGdaFrame()->Bind(wxEVT_COMMAND_MENU_SELECTED,
&GdaFrame::OnCustomCategoryClick,
GdaFrame::GetGdaFrame(),
GdaConst::ID_CUSTOM_CAT_CLASSIF_CHOICE_A0,
GdaConst::ID_CUSTOM_CAT_CLASSIF_CHOICE_A0 + titles.size());
}
}
PopupMenu(popupMenu, wxDefaultPosition);
}
}
void GdaFrame::OnShapePolygonsFromGrid(wxCommandEvent& WXUNUSED(event) )
{
wxLogMessage("Open CreateGridDlg");
// check if dialog has already been opened
wxWindowList::compatibility_iterator node = wxTopLevelWindows.GetFirst();
while (node) {
wxWindow* win = node->GetData();
if (CreateGridDlg* w = dynamic_cast<CreateGridDlg*>(win)) {
w->Update();
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
node = node->GetNext();
}
CreateGridDlg* dlg = new CreateGridDlg(this, GetProject());
dlg->Show(true);
}
void GdaFrame::OnShapePolygonsFromBoundary(wxCommandEvent& WXUNUSED(event) )
{
wxLogMessage("Open Bnd2ShpDlg");
Bnd2ShpDlg dlg(this);
dlg.ShowModal();
}
void GdaFrame::OnShowTimeChooser(wxCommandEvent& event)
{
Project* p = GetProject();
if (!p || !p->GetTableInt()) return;
wxPoint pt;
bool hasTime = p->GetTableInt()->IsTimeVariant();
bool opened = false;
FramesManager* fm = p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (TimeChooserDlg* w = dynamic_cast<TimeChooserDlg*>(*it)) {
w->Show(true);
w->Maximize(false);
w->Raise();
pt = w->GetPosition();
opened = true;
}
}
if (!opened) {
TimeChooserDlg* dlg = new TimeChooserDlg(0, p->GetFramesManager(),
p->GetTimeState(),
p->GetTableState(),
p->GetTableInt());
dlg->Show(true);
pt = dlg->GetPosition();
}
opened = false;
for (it=observers.begin(); it != observers.end(); ++it) {
if (VarGroupingEditorDlg* w = dynamic_cast<VarGroupingEditorDlg*>(*it))
{
w->Show(true);
w->Maximize(false);
w->Raise();
w->SetPosition(wxPoint(pt.x, pt.y + 130));
opened =true;
break;
}
}
if (!opened) {
VarGroupingEditorDlg* dlg = new VarGroupingEditorDlg(p, this);
dlg->Show(true);
int start_x = pt.x - 200;
if (start_x) start_x = 0;
dlg->SetPosition(wxPoint(pt.x, pt.y + 130));
}
}
void GdaFrame::OnShowDataMovie(wxCommandEvent& event)
{
Project* p = GetProject();
if (!p || !p->GetTableInt()) return;
FramesManager* fm = p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (DataMovieDlg* w = dynamic_cast<DataMovieDlg*>(*it)) {
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
DataMovieDlg* dlg = new DataMovieDlg(0, p->GetFramesManager(),
p->GetTableState(),
p->GetTimeState(),
p->GetTableInt(),
p->GetHighlightState());
dlg->Show(true);
}
void GdaFrame::OnShowCatClassif(wxCommandEvent& event)
{
Project* p = GetProject();
if (!p || !p->GetTableInt()) return;
FramesManager* fm = p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (CatClassifFrame* w = dynamic_cast<CatClassifFrame*>(*it)) {
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
// memory managed by wx
CatClassifFrame* dlg = new CatClassifFrame(this, project_p, false, true);
}
CatClassifFrame* GdaFrame::GetCatClassifFrame(bool useScientificNotation)
{
Project* p = GetProject();
if (!p || !p->GetTableInt()) return 0;
FramesManager* fm = p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (CatClassifFrame* w = dynamic_cast<CatClassifFrame*>(*it)) {
w->Show(true);
w->Maximize(false);
w->Raise();
return w;
}
}
CatClassifFrame* dlg = new CatClassifFrame(this, project_p, useScientificNotation);
return dlg;
}
void GdaFrame::OnVarGroupingEditor(wxCommandEvent& event)
{
Project* p = GetProject();
if (!p || !p->GetTableInt()) return;
FramesManager* fm = p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (VarGroupingEditorDlg* w = dynamic_cast<VarGroupingEditorDlg*>(*it))
{
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
VarGroupingEditorDlg* dlg = new VarGroupingEditorDlg(GetProject(), this);
dlg->Show(true);
}
void GdaFrame::OnTimeEditor(wxCommandEvent& event)
{
if (!GetProject() || !GetProject()->GetTableInt()) return;
FramesManager* fm = GetProject()->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (TimeEditorDlg* w = dynamic_cast<TimeEditorDlg*>(*it)) {
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
TimeEditorDlg* dlg = new TimeEditorDlg(0, GetProject()->GetFramesManager(),
GetProject()->GetTableState(),
GetProject()->GetTableInt());
dlg->Show(true);
}
void GdaFrame::OnMoveSelectedToTop(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnMoveSelectedToTop");
if (!project_p || !project_p->FindTableBase()) return;
project_p->FindTableBase()->MoveSelectedToTop();
}
void GdaFrame::OnInvertSelection(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnInvertSelection");
if (!project_p || !project_p->FindTableBase()) return;
HighlightState& hs = *project_p->GetHighlightState();
hs.SetEventType(HLStateInt::invert);
hs.notifyObservers();
}
void GdaFrame::OnClearSelection(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnClearSelection");
if (!project_p || !project_p->FindTableBase()) return;
project_p->FindTableBase()->DeselectAllRows();
}
void GdaFrame::OnRangeSelection(wxCommandEvent& event)
{
if (!GetProject() || !GetProject()->GetTableInt()) return;
FramesManager* fm = GetProject()->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (RangeSelectionDlg* w = dynamic_cast<RangeSelectionDlg*>(*it)) {
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
RangeSelectionDlg* dlg = new RangeSelectionDlg(0, GetProject(),
GetProject()->GetFramesManager(),
GetProject()->GetTableState());
dlg->Show(true);
}
void GdaFrame::OnFieldCalculation(wxCommandEvent& event)
{
if (!GetProject()) return;
FramesManager* fm = GetProject()->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (FieldNewCalcSheetDlg* w = dynamic_cast<FieldNewCalcSheetDlg*>(*it)) {
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
FieldNewCalcSheetDlg* dlg =
new FieldNewCalcSheetDlg(GetProject(), this,
wxID_ANY, _("Calculator"),
wxDefaultPosition,
wxSize(700, 500));
dlg->Show(true);
}
void GdaFrame::OnCalculator(wxCommandEvent& event)
{
wxWindowList::compatibility_iterator node = wxTopLevelWindows.GetFirst();
while (node) {
wxWindow* win = node->GetData();
if (CalculatorDlg* w = dynamic_cast<CalculatorDlg*>(win)) {
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
node = node->GetNext();
}
// GetProject() could be NULL, but CalculatorDlg supports this.
CalculatorDlg* dlg = new CalculatorDlg(GetProject(), this);
dlg->Show(true);
}
void GdaFrame::OnAddCol(wxCommandEvent& event)
{
if (!project_p || !project_p->GetTableInt()) return;
DataViewerAddColDlg dlg(project_p, this);
dlg.ShowModal();
}
void GdaFrame::OnDeleteCol(wxCommandEvent& event)
{
if (!project_p || !project_p->GetTableInt()) return;
DataViewerDeleteColDlg dlg(project_p->GetTableInt(), this);
dlg.ShowModal();
}
void GdaFrame::OnEditFieldProperties(wxCommandEvent& event)
{
Project* p = GetProject();
if (!p || !p->GetTableInt()) return;
/*
FramesManager* fm = p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (DataViewerEditFieldPropertiesDlg* w
= dynamic_cast<DataViewerEditFieldPropertiesDlg*>(*it))
{
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
*/
DataViewerEditFieldPropertiesDlg
dlg(p, wxDefaultPosition, wxSize(600, 400));
dlg.ShowModal();
}
/*
void GdaFrame::OnChangeFieldType(wxCommandEvent& event)
{
Project* p = GetProject();
if (!p || !p->GetTableInt()) return;
FramesManager* fm = p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (DataChangeTypeFrame* w = dynamic_cast<DataChangeTypeFrame*>(*it))
{
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
DataChangeTypeFrame* dlg = new DataChangeTypeFrame(this, p);
}
*/
void GdaFrame::OnMergeTableData(wxCommandEvent& event)
{
if (!project_p || !project_p->FindTableBase()) return;
FramesManager* fm = project_p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (MergeTableDlg* w = dynamic_cast<MergeTableDlg*>(*it))
{
w->Init();
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
MergeTableDlg* dlg = new MergeTableDlg(this,
project_p,
wxDefaultPosition);
dlg->Show(true);
}
void GdaFrame::OnAggregateData(wxCommandEvent& event)
{
if (!project_p || !project_p->FindTableBase()) return;
FramesManager* fm = project_p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (AggregationDlg* w = dynamic_cast<AggregationDlg*>(*it))
{
w->Init();
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
AggregationDlg* dlg = new AggregationDlg(this, project_p);
dlg->Show(true);
}
void GdaFrame::OnSpatialJoin(wxCommandEvent& event)
{
if (!project_p || !project_p->FindTableBase()) return;
if (project_p->IsTableOnlyProject()) {
wxMessageDialog dlg (this,
_("Spatial Join does not work with Table only datasource."),
_("Info"), wxOK | wxICON_INFORMATION);
dlg.ShowModal();
return;
}
if (project_p->GetMapLayerCount() == 0) {
wxMessageDialog dlg (this,
_("Please load another layer using map window to apply Spatial Join."),
_("Info"), wxOK | wxICON_INFORMATION);
dlg.ShowModal();
return;
}
SpatialJoinDlg dlg(this, project_p);
if (dlg.ShowModal() == wxID_OK) {
OnOpenNewTable();
}
}
void GdaFrame::OnDissolve(wxCommandEvent& event)
{
if (!project_p || !project_p->FindTableBase()) return;
if (project_p->IsTableOnlyProject()) {
wxMessageDialog dlg (this,
_("Dissolve does not work with Table only datasource."),
_("Info"), wxOK | wxICON_INFORMATION);
dlg.ShowModal();
return;
}
if (project_p->GetShapeType() != Shapefile::POLYGON) {
wxMessageDialog dlg (this,
_("Dissolve only works on polygon dataset."),
_("Warning"), wxOK | wxICON_INFORMATION);
dlg.ShowModal();
return;
}
DissolveDlg* dlg = new DissolveDlg(this, project_p);
dlg->Show(true);
}
void GdaFrame::OnGroupingMap(wxCommandEvent& event)
{
if (!project_p || !project_p->FindTableBase()) return;
if (project_p->IsTableOnlyProject()) {
wxMessageDialog dlg (this,
_("Hierarchical Map does not work with Table only datasource."),
_("Info"), wxOK | wxICON_INFORMATION);
dlg.ShowModal();
return;
}
HierachicalMapSelectDlg dlg(this, project_p);
if (dlg.ShowModal() == wxID_OK) {
HierachicalMapFrame* nf = new HierachicalMapFrame(this, project_p,
dlg.GetVarInfo(),
dlg.GetColIds(),
dlg.GetWUID(),
dlg.GetTitle(),
wxDefaultPosition,
GdaConst::map_default_size);
nf->Show(true);
}
}
void GdaFrame::OnExportSelectedToOGR(wxCommandEvent& event)
{
if (!project_p || !project_p->GetTableInt()) return;
vector<int> selected_rows;
project_p->GetSelectedRows(selected_rows);
if ( selected_rows.empty() ) {
wxMessageDialog dlg (this,
_("Please select features first."),
_("Info"), wxOK | wxICON_INFORMATION);
dlg.ShowModal();
return;
}
ExportDataDlg dlg(this, project_p, true);
dlg.ShowModal();
}
void GdaFrame::OnExportToOGR(wxCommandEvent& event)
{
if (!project_p || !project_p->GetTableInt())
return;
ExportDataDlg dlg(this, project_p);
dlg.ShowModal();
}
/** Export to CSV. This is not used currently. */
void GdaFrame::OnExportToCsvFile(wxCommandEvent& event)
{
if (!project_p || !project_p->GetTableInt())
return;
ExportCsvDlg dlg(this, project_p);
dlg.ShowModal();
}
void GdaFrame::OnShowProjectInfo(wxCommandEvent& event)
{
if (!project_p) return;
ProjectInfoDlg dlg(project_p);
dlg.ShowModal();
}
void GdaFrame::OnPreferenceSetup(wxCommandEvent& event)
{
if (!project_p) {
PreferenceDlg dlg(this);
dlg.Show(true);
} else {
PreferenceDlg dlg(this, project_p->GetHighlightState(),
project_p->GetTableState());
dlg.Show(true);
}
}
void GdaFrame::OnHtmlEntry(int entry)
{
if (!GetProject()) return;
WebViewExampleDlg* dlg =
new WebViewExampleDlg(project_p,
htmlMenuItems[entry].url,
this, wxID_ANY,
htmlMenuItems[entry].menu_title);
dlg->Show(true);
}
void GdaFrame::OnHtmlEntry0(wxCommandEvent& event) { OnHtmlEntry(0); }
void GdaFrame::OnHtmlEntry1(wxCommandEvent& event) { OnHtmlEntry(1); }
void GdaFrame::OnHtmlEntry2(wxCommandEvent& event) { OnHtmlEntry(2); }
void GdaFrame::OnHtmlEntry3(wxCommandEvent& event) { OnHtmlEntry(3); }
void GdaFrame::OnHtmlEntry4(wxCommandEvent& event) { OnHtmlEntry(4); }
void GdaFrame::OnHtmlEntry5(wxCommandEvent& event) { OnHtmlEntry(5); }
void GdaFrame::OnHtmlEntry6(wxCommandEvent& event) { OnHtmlEntry(6); }
void GdaFrame::OnHtmlEntry7(wxCommandEvent& event) { OnHtmlEntry(7); }
void GdaFrame::OnHtmlEntry8(wxCommandEvent& event) { OnHtmlEntry(8); }
void GdaFrame::OnHtmlEntry9(wxCommandEvent& event) { OnHtmlEntry(9); }
void GdaFrame::OnGeneratePointShpFile(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnGeneratePointShpFile()");
if (!GetProject() || !GetProject()->GetTableInt()) {
return;
}
Project* p = GetProject();
TableInterface* table_int = p->GetTableInt();
VariableSettingsDlg VS(GetProject(), VariableSettingsDlg::bivariate,
false, false,
_("New Map Coordinates"),
_("First Variable (X/Longitude)"),
_("Second Variable (Y/Latitude)"));
if (VS.ShowModal() != wxID_OK) {
return;
}
std::vector<double> xs;
std::vector<double> ys;
std::vector<bool> undefs;
std::vector<bool> undefs_x(p->GetNumRecords());
std::vector<bool> undefs_y(p->GetNumRecords());
table_int->GetColData(VS.col_ids[0], VS.var_info[0].time, xs, undefs_x);
table_int->GetColData(VS.col_ids[1], VS.var_info[1].time, ys, undefs_y);
for (int i=0; i<undefs_x.size(); i++) {
bool undef = undefs_x[i] || undefs_y[i];
undefs.push_back(undef);
}
if (p->IsTableOnlyProject()) {
int n_rows = xs.size();
// clean p->main_data
if (!p->main_data.records.empty()) {
p->main_data.records.clear();
}
p->main_data.header.shape_type = Shapefile::POINT_TYP;
p->main_data.records.resize(n_rows);
double min_x = 0.0, min_y = 0.0, max_x = 0.0, max_y = 0.0;
bool is_first = true;
for ( int i=0; i < n_rows; i++ ) {
Shapefile::PointContents* pc = new Shapefile::PointContents();
pc->shape_type = Shapefile::POINT_TYP;
pc->x = xs[i];
pc->y = ys[i];
pc->shape_type = undefs[i] ? 0 : 1;
p->main_data.records[i].contents_p = pc;
if (undefs[i])
continue;
if (is_first) {
min_x = max_x = xs[i];
min_y = max_y = ys[i];
is_first = false;
}
if ( xs[i] < min_x )
min_x = xs[i];
else if ( xs[i] > max_x )
max_x = xs[i];
if ( ys[i] < min_y )
min_y = ys[i];
else if ( ys[i] > max_y )
max_y = ys[i];
}
p->main_data.header.bbox_x_min = min_x;
p->main_data.header.bbox_y_min = min_y;
p->main_data.header.bbox_x_max = max_x;
p->main_data.header.bbox_y_max = max_y;
p->main_data.header.bbox_z_min = 0;
p->main_data.header.bbox_z_max = 0;
p->main_data.header.bbox_m_min = 0;
p->main_data.header.bbox_m_max = 0;
p->isTableOnly = false;
UpdateToolbarAndMenus();
std::vector<int> col_ids;
std::vector<GdaVarTools::VarInfo> var_info;
MapFrame* nf = new MapFrame(this, p, var_info, col_ids,
CatClassification::no_theme,
MapCanvas::no_smoothing, 1,
boost::uuids::nil_uuid(),
wxDefaultPosition,
GdaConst::map_default_size);
nf->UpdateTitle();
} else {
// for other cases, just save as points with table
std::vector<GdaShape*> points;
int n_rows = xs.size();
for ( int i=0; i < n_rows; i++ ) {
GdaShape* p = new GdaPoint(xs[i], ys[i]);
points.push_back(p);
}
ExportDataDlg export_dlg(NULL, points, Shapefile::POINT_TYP, p,false);
export_dlg.ShowModal();
}
}
void GdaFrame::OnRegressionClassic(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnRegressionClassic()");
Project* p = GetProject();
if (p == NULL)
return;
FramesManager* fm = project_p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (RegressionDlg* w = dynamic_cast<RegressionDlg*>(*it))
{
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
RegressionDlg* dlg = new RegressionDlg(project_p, this);
dlg->Show(true);
}
void GdaFrame::OnPublish(wxCommandEvent& event)
{
Project* p = GetProject();
if (p) {
PublishDlg dlg(this,p);
dlg.ShowModal();
}
}
void GdaFrame::DisplayRegression(const wxString dump)
{
wxLogMessage("In GdaFrame::DisplayRegression()");
Project* p = GetProject();
if (!p) return;
RegressionReportDlg *regReportDlg = new RegressionReportDlg(this, dump);
regReportDlg->Show(true);
regReportDlg->m_textbox->SetSelection(0, 0);
}
void GdaFrame::OnCondPlotChoices(wxCommandEvent& WXUNUSED(event))
{
wxLogMessage("In GdaFrame::OnCondPlotChoices()");
Project* p = GetProject();
if (!p) return;
wxMenu* popupMenu = wxXmlResource::Get()->LoadMenu("ID_COND_MENU");
if (popupMenu) {
Project* p = GetProject();
bool proj_open = (p != 0);
bool shp_proj = proj_open && !p->IsTableOnlyProject();
GeneralWxUtils::EnableMenuItem(popupMenu,
XRCID("ID_SHOW_CONDITIONAL_MAP_VIEW"),
shp_proj);
GeneralWxUtils::EnableMenuItem(popupMenu,
XRCID("ID_SHOW_CONDITIONAL_HIST_VIEW"),
proj_open);
GeneralWxUtils::EnableMenuItem(popupMenu,
XRCID("ID_SHOW_CONDITIONAL_SCATTER_VIEW"),
proj_open);
GeneralWxUtils::EnableMenuItem(popupMenu,
XRCID("ID_SHOW_CONDITIONAL_BOX_VIEW"),
proj_open);
PopupMenu(popupMenu, wxDefaultPosition);
}
}
void GdaFrame::OnClusteringChoices(wxCommandEvent& WXUNUSED(event))
{
Project* p = GetProject();
if (!p) return;
wxMenu* popupMenu = wxXmlResource::Get()->LoadMenu("ID_CLUSTERING_MENU");
if (popupMenu) {
Project* p = GetProject();
bool proj_open = (p != 0);
bool shp_proj = proj_open;
GeneralWxUtils::EnableMenuItem(popupMenu, XRCID("ID_TOOLS_DATA_PCA"),shp_proj);
GeneralWxUtils::EnableMenuItem(popupMenu,XRCID("ID_TOOLS_DATA_KMEANS"), proj_open);
GeneralWxUtils::EnableMenuItem(popupMenu,XRCID("ID_TOOLS_DATA_KMEDIANS"), proj_open);
GeneralWxUtils::EnableMenuItem(popupMenu,XRCID("ID_TOOLS_DATA_KMEDOIDS"), proj_open);
GeneralWxUtils::EnableMenuItem(popupMenu,XRCID("ID_TOOLS_DATA_HCLUSTER"),proj_open);
GeneralWxUtils::EnableMenuItem(popupMenu,XRCID("ID_TOOLS_DATA_DBSCAN"),proj_open);
GeneralWxUtils::EnableMenuItem(popupMenu,XRCID("ID_TOOLS_DATA_HDBSCAN"),proj_open);
GeneralWxUtils::EnableMenuItem(popupMenu,XRCID("ID_TOOLS_DATA_SPECTRAL"),proj_open);
GeneralWxUtils::EnableMenuItem(popupMenu,XRCID("ID_TOOLS_DATA_MAXP"),proj_open);
GeneralWxUtils::EnableMenuItem(popupMenu,XRCID("ID_TOOLS_DATA_AZP"),proj_open);
GeneralWxUtils::EnableMenuItem(popupMenu,XRCID("ID_TOOLS_DATA_SKATER"),proj_open);
GeneralWxUtils::EnableMenuItem(popupMenu,XRCID("ID_TOOLS_DATA_SCHC"),proj_open);
GeneralWxUtils::EnableMenuItem(popupMenu,XRCID("ID_TOOLS_DATA_REDCAP"),proj_open);
GeneralWxUtils::EnableMenuItem(popupMenu,XRCID("ID_TOOLS_DATA_MDS"),proj_open);
GeneralWxUtils::EnableMenuItem(popupMenu,XRCID("ID_TOOLS_DATA_TSNE"),proj_open);
PopupMenu(popupMenu, wxDefaultPosition);
}
}
void GdaFrame::OnShowConditionalMapView(wxCommandEvent& WXUNUSED(event) )
{
Project* p = GetProject();
if (!p) return;
int style = VariableSettingsDlg::ALLOW_STRING_IN_FIRST | VariableSettingsDlg::ALLOW_STRING_IN_SECOND | VariableSettingsDlg::ALLOW_EMPTY_IN_FIRST | VariableSettingsDlg::ALLOW_EMPTY_IN_SECOND ;
if (p->GetTableInt()->IsTimeVariant()) style = style | VariableSettingsDlg::SHOW_TIME;
VariableSettingsDlg dlg(project_p, VariableSettingsDlg::trivariate, style,
_("Conditional Map Variables"),
_("Horizontal Cells"),
_("Vertical Cells"),
_("Map Theme"));
if (dlg.ShowModal() != wxID_OK) return;
ConditionalMapFrame* subframe =
new ConditionalMapFrame(GdaFrame::gda_frame, project_p,
dlg.var_info, dlg.col_ids,
_("Conditional Map"), wxDefaultPosition,
GdaConst::cond_view_default_size);
}
void GdaFrame::OnShowConditionalHistView(wxCommandEvent& WXUNUSED(event))
{
Project* p = GetProject();
if (!p) return;
int style = VariableSettingsDlg::ALLOW_STRING_IN_FIRST | VariableSettingsDlg::ALLOW_STRING_IN_SECOND | VariableSettingsDlg::ALLOW_EMPTY_IN_FIRST | VariableSettingsDlg::ALLOW_EMPTY_IN_SECOND;
if (p->GetTableInt()->IsTimeVariant()) style = style | VariableSettingsDlg::SHOW_TIME;
VariableSettingsDlg dlg(project_p, VariableSettingsDlg::trivariate, style,
_("Conditional Histogram Variables"),
_("Horizontal Cells"),
_("Vertical Cells"),
_("Histogram Variable"));
if (dlg.ShowModal() != wxID_OK) return;
ConditionalHistogramFrame* subframe =
new ConditionalHistogramFrame(GdaFrame::gda_frame, project_p,
dlg.var_info, dlg.col_ids,
_("Conditional Histogram"), wxDefaultPosition,
GdaConst::cond_view_default_size);
}
void GdaFrame::OnShowConditionalBoxView(wxCommandEvent& WXUNUSED(event))
{
Project* p = GetProject();
if (!p) return;
int style = VariableSettingsDlg::ALLOW_STRING_IN_FIRST | VariableSettingsDlg::ALLOW_STRING_IN_SECOND | VariableSettingsDlg::ALLOW_EMPTY_IN_FIRST | VariableSettingsDlg::ALLOW_EMPTY_IN_SECOND;
if (p->GetTableInt()->IsTimeVariant()) style = style | VariableSettingsDlg::SHOW_TIME;
VariableSettingsDlg dlg(project_p, VariableSettingsDlg::trivariate, style,
_("Conditional Box Plot Variables"),
_("Horizontal Cells"),
_("Vertical Cells"),
_("Box Plot Variable"));
if (dlg.ShowModal() != wxID_OK) return;
ConditionalBoxPlotFrame* subframe =
new ConditionalBoxPlotFrame(GdaFrame::gda_frame, project_p,
dlg.var_info, dlg.col_ids,
_("Conditional Box Plot"), wxDefaultPosition,
GdaConst::cond_view_default_size);
}
void GdaFrame::OnShowConditionalScatterView(wxCommandEvent& WXUNUSED(event))
{
Project* p = GetProject();
if (!p) return;
int style = VariableSettingsDlg::ALLOW_STRING_IN_FIRST | VariableSettingsDlg::ALLOW_STRING_IN_SECOND | VariableSettingsDlg::ALLOW_EMPTY_IN_FIRST | VariableSettingsDlg::ALLOW_EMPTY_IN_SECOND;
if (p->GetTableInt()->IsTimeVariant()) style = style | VariableSettingsDlg::SHOW_TIME;
VariableSettingsDlg dlg(project_p, VariableSettingsDlg::quadvariate, style,
_("Conditional Scatter Plot Variables"),
_("Horizontal Cells"),
_("Vertical Cells"),
_("Independent Var (x-axis)"),
_("Dependent Var (y-axis)"));
if (dlg.ShowModal() != wxID_OK) return;
// memory managed by wx
ConditionalScatterPlotFrame* subframe =
new ConditionalScatterPlotFrame(GdaFrame::gda_frame, project_p,
dlg.var_info, dlg.col_ids,
_("Conditional Scatter Plot"),
wxDefaultPosition,
GdaConst::cond_view_default_size);
}
void GdaFrame::OnShowCartogramNewView(wxCommandEvent& WXUNUSED(event) )
{
Project* p = GetProject();
if (!p) return;
VariableSettingsDlg dlg(project_p, VariableSettingsDlg::bivariate, false, false,
_("Cartogram Variables"),
_("Circle Size"), _("Circle Color"), "", "",
true, false); // set second var from first
if (dlg.ShowModal() != wxID_OK)
return;
// memory managed by wx
CartogramNewFrame* subframe =
new CartogramNewFrame(GdaFrame::gda_frame, project_p,
dlg.var_info, dlg.col_ids,
_("Cartogram"), wxDefaultPosition,
GdaConst::map_default_size);
}
void GdaFrame::OnCartogramImprove1(wxCommandEvent& event )
{
wxLogMessage("In GdaFrame::OnCartogramImprove1()");
Project* p = GetProject();
if (!p) return;
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (CartogramNewFrame* f = dynamic_cast<CartogramNewFrame*>(t)) {
f->CartogramImproveLevel(0);
}
}
void GdaFrame::OnCartogramImprove2(wxCommandEvent& event )
{
wxLogMessage("In GdaFrame::OnCartogramImprove2()");
Project* p = GetProject();
if (!p) return;
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (CartogramNewFrame* f = dynamic_cast<CartogramNewFrame*>(t)) {
f->CartogramImproveLevel(1);
}
}
void GdaFrame::OnCartogramImprove3(wxCommandEvent& event )
{
wxLogMessage("In GdaFrame::OnCartogramImprove3()");
Project* p = GetProject();
if (!p) return;
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (CartogramNewFrame* f = dynamic_cast<CartogramNewFrame*>(t)) {
f->CartogramImproveLevel(2);
}
}
void GdaFrame::OnCartogramImprove4(wxCommandEvent& event )
{
wxLogMessage("In GdaFrame::OnCartogramImprove4()");
Project* p = GetProject();
if (!p) return;
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (CartogramNewFrame* f = dynamic_cast<CartogramNewFrame*>(t)) {
f->CartogramImproveLevel(3);
}
}
void GdaFrame::OnCartogramImprove5(wxCommandEvent& event )
{
wxLogMessage("In GdaFrame::OnCartogramImprove5()");
Project* p = GetProject();
if (!p) return;
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (CartogramNewFrame* f = dynamic_cast<CartogramNewFrame*>(t)) {
f->CartogramImproveLevel(4);
}
}
void GdaFrame::OnCartogramImprove6(wxCommandEvent& event )
{
wxLogMessage("In GdaFrame::OnCartogramImprove6()");
Project* p = GetProject();
if (!p) return;
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (CartogramNewFrame* f = dynamic_cast<CartogramNewFrame*>(t)) {
f->CartogramImproveLevel(5);
}
}
void GdaFrame::OnExploreHist(wxCommandEvent& WXUNUSED(event))
{
Project* p = GetProject();
if (!p) return;
bool show_str_var = true;
VariableSettingsDlg VS(project_p, VariableSettingsDlg::univariate,
// default values
false,false,_("Variable Settings"),"","","","",false,false,false,
show_str_var);
if (VS.ShowModal() != wxID_OK)
return;
// memory managed by wx
HistogramFrame* f = new HistogramFrame(GdaFrame::gda_frame, project_p,
VS.var_info, VS.col_ids,
_("Histogram"),
wxDefaultPosition,
GdaConst::hist_default_size);
}
void GdaFrame::OnExploreScatterNewPlot(wxCommandEvent& WXUNUSED(event))
{
Project* p = GetProject();
if (!p) return;
VariableSettingsDlg dlg(project_p, VariableSettingsDlg::bivariate,
false,
false,
_("Scatter Plot Variables"),
_("Independent Var X"),
_("Dependent Var Y"));
if (dlg.ShowModal() != wxID_OK)
return;
wxString title;
ScatterNewPlotFrame* subframe =
new ScatterNewPlotFrame(GdaFrame::gda_frame, project_p,
dlg.var_info, dlg.col_ids,
false, title, wxDefaultPosition,
GdaConst::scatterplot_default_size,
wxDEFAULT_FRAME_STYLE);
}
void GdaFrame::OnExploreBubbleChart(wxCommandEvent& WXUNUSED(event))
{
Project* p = GetProject();
if (!p) return;
VariableSettingsDlg dlg(project_p, VariableSettingsDlg::quadvariate,
false, false,
_("Bubble Chart Variables"),
_("X-Axis"), _("Y-Axis"),
_("Bubble Size"), _("Standard Deviation Color"),
false, true); // set fourth variable from third
if (dlg.ShowModal() != wxID_OK) return;
wxString title;
ScatterNewPlotFrame* subframe =
new ScatterNewPlotFrame(GdaFrame::gda_frame, project_p,
dlg.var_info, dlg.col_ids,
true, title, wxDefaultPosition,
GdaConst::bubble_chart_default_size,
wxDEFAULT_FRAME_STYLE);
}
void GdaFrame::OnExploreScatterPlotMat(wxCommandEvent& WXUNUSED(event))
{
Project* p = GetProject();
if (!p) return;
ScatterPlotMatFrame* f =
new ScatterPlotMatFrame(GdaFrame::gda_frame, project_p,
_("Scatter Plot Matrix"), wxDefaultPosition,
GdaConst::scatterplot_default_size);
}
void GdaFrame::OnExploreTestMap(wxCommandEvent& WXUNUSED(event))
{
/*
MapFrame* subframe = new MapFrame(frame, project_p,
MapCanvas::no_theme,
MapCanvas::no_smoothing, 1,
boost::uuids::nil_uuid(),
wxDefaultPosition,
GdaConst::map_default_size);
subframe->UpdateTitle();
TestMapFrame *subframe = new TestMapFrame(frame, project_p,
"Test Map Frame",
wxDefaultPosition,
GdaConst::map_default_size,
wxDEFAULT_FRAME_STYLE);
*/
}
void GdaFrame::OnExploreNewBox(wxCommandEvent& WXUNUSED(event))
{
Project* p = GetProject();
if (!p) return;
VariableSettingsDlg VS(project_p, VariableSettingsDlg::univariate);
if (VS.ShowModal() != wxID_OK) return;
wxSize size = GdaConst::boxplot_default_size;
int w = size.GetWidth();
if (VS.var_info[0].is_time_variant) size.SetWidth((w*3)/2);
else size.SetWidth(w/2);
BoxPlotFrame *sf = new BoxPlotFrame(GdaFrame::gda_frame, GetProject(),
VS.var_info, VS.col_ids,
_("Box Plot"), wxDefaultPosition,
size);
}
void GdaFrame::OnExplorePCP(wxCommandEvent& WXUNUSED(event))
{
Project* p = GetProject();
if (!p) return;
PCPDlg dlg(p,this);
if (dlg.ShowModal() != wxID_OK)
return;
PCPFrame* s = new PCPFrame(this, p, dlg.var_info, dlg.col_ids);
}
void GdaFrame::OnExplore3DP(wxCommandEvent& WXUNUSED(event))
{
//MyFrame* subframe = new MyFrame("rwar");
//subframe->Show();
Project* p = GetProject();
if (!p) return;
VariableSettingsDlg dlg(p, VariableSettingsDlg::trivariate, false, false,
_("3D Scatter Plot Variables"), "X", "Y", "Z");
if (dlg.ShowModal() != wxID_OK)
return;
C3DPlotFrame *subframe =
new C3DPlotFrame(GdaFrame::gda_frame, p,
dlg.var_info, dlg.col_ids,
_("3D Plot"), std::vector<wxString>(),
std::vector<std::pair<wxString, double> >(),
wxDefaultPosition, GdaConst::three_d_default_size,
wxDEFAULT_FRAME_STYLE);
}
void GdaFrame::OnExploreLineChart(wxCommandEvent& WXUNUSED(event))
{
Project* p = GetProject();
if (!p) return;
LineChartFrame* f = new LineChartFrame(GdaFrame::gda_frame, project_p,
_("Average Comparison Chart"),
wxDefaultPosition,
GdaConst::line_chart_default_size);
}
void GdaFrame::OnExploreCovScatterPlot(wxCommandEvent& WXUNUSED(event))
{
Project* p = GetProject();
if (!p) return;
VariableSettingsDlg VS(project_p, VariableSettingsDlg::univariate,
false, true, _("Variable Choice"), _("Variable"));
if (VS.ShowModal() != wxID_OK)
return;
GdaVarTools::VarInfo& v = VS.var_info[0];
std::vector<wxString> tm_strs;
project_p->GetTableInt()->GetTimeStrings(tm_strs);
GdaVarTools::Manager var_man(tm_strs);
var_man.AppendVar(v.name, v.min, v.max, v.time,
v.sync_with_global_time, v.fixed_scale);
CovSpFrame* f = new CovSpFrame(GdaFrame::gda_frame, project_p, var_man,
VS.GetDistanceMetric(),
VS.GetDistanceUnits());
}
void GdaFrame::OnExploreCorrelogram(wxCommandEvent& WXUNUSED(event))
{
Project* p = GetProject();
if (!p) return;
CorrelogramFrame* f = new CorrelogramFrame(GdaFrame::gda_frame, p,
_("Correlogram"), wxDefaultPosition,
GdaConst::scatterplot_default_size);
}
void GdaFrame::OnDistancePlot(wxCommandEvent& WXUNUSED(event))
{
Project* p = GetProject();
if (!p) return;
FramesManager* fm = p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (DistancePlotDlg* w = dynamic_cast<DistancePlotDlg*>(*it)) {
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
DistancePlotDlg* dlg = new DistancePlotDlg(this, p);
dlg->Show(true);
}
void GdaFrame::OnToolOpenNewTable(wxCommandEvent& WXUNUSED(event))
{
OnOpenNewTable();
}
void GdaFrame::OnToolsChoices(wxCommandEvent& WXUNUSED(event))
{
Project* p = GetProject();
if (!p) return;
wxMenu* popupMenu = wxXmlResource::Get()->LoadMenu("ID_TOOLS_MENU");
if (popupMenu) PopupMenu(popupMenu, wxDefaultPosition);
}
void GdaFrame::OnMoranMenuChoices(wxCommandEvent& WXUNUSED(event))
{
Project* p = GetProject();
if (!p) return;
wxMenu* popupMenu = wxXmlResource::Get()->LoadMenu("ID_MORAN_MENU");
if (popupMenu) PopupMenu(popupMenu, wxDefaultPosition);
}
void GdaFrame::OnOpenMSPL(wxCommandEvent& event)
{
wxLogMessage("Open LisaScatterPlotFrame (OnOpenMSPL).");
Project* p = GetProject();
if (!p) return;
std::vector<boost::uuids::uuid> weights_ids;
WeightsManInterface* w_man_int = p->GetWManInt();
w_man_int->GetIds(weights_ids);
if (weights_ids.size()==0) {
wxMessageDialog dlg (this, _("GeoDa could not find the required weights file. \nPlease specify weights in Tools > Weights Manager."), _("No Weights Found"), wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
}
VariableSettingsDlg VS(project_p, VariableSettingsDlg::univariate, true, false);
if (VS.ShowModal() != wxID_OK)
return;
boost::uuids::uuid w_id = VS.GetWeightsId();
if (w_id.is_nil()) return;
GalWeight* gw = w_man_int->GetGal(w_id);
if (gw == NULL) {
wxMessageDialog dlg (this, _("Invalid Weights Information:\n\n The selected weights file is not valid.\n Please choose another weights file, or use Tools > Weights > Weights Manager\n to define a valid weights file."), _("Warning"), wxOK | wxICON_WARNING);
dlg.ShowModal();
return;
}
bool cont = true;
for (int i=0; i<p->GetNumRecords(); i++) {
if (gw->gal[i].Size() == 0 ) {
wxMessageDialog dlg (this, _("Moran scatter plot is not supported when isolates are present in weights. Do you want to continue by removing the isolates when compute Moran's I?"), _("Warning"), wxYES_NO | wxICON_WARNING);
if (dlg.ShowModal() == wxID_NO) {
cont = false;
}
break;
}
}
if (!cont) {
return;
}
LisaCoordinator* lc = new LisaCoordinator(w_id, project_p,
VS.var_info, VS.col_ids,
LisaCoordinator::univariate,
false);
LisaScatterPlotFrame *f = new LisaScatterPlotFrame(GdaFrame::gda_frame,
project_p, lc);
}
void GdaFrame::OnOpenDiffMoran(wxCommandEvent& event)
{
wxLogMessage("Open LisaScatterPlotFrame (OnOpenDiffMoran).");
Project* p = GetProject();
if (!p) return;
std::vector<boost::uuids::uuid> weights_ids;
WeightsManInterface* w_man_int = p->GetWManInt();
w_man_int->GetIds(weights_ids);
if (weights_ids.size()==0) {
wxMessageDialog dlg (this, _("GeoDa could not find the required weights file. \nPlease specify weights in Tools > Weights Manager."), _("No Weights Found"), wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
}
TableInterface* table_int = p->GetTableInt();
bool has_time = table_int->IsTimeVariant();
if (has_time == false) {
wxMessageDialog dlg (this, _("Differential Moran's I tests whether the change in a variable over time is spatially correlated.\n\nPlease first group variables by time period: Select Time --> Time Editor."), _("Warning"), wxOK | wxICON_WARNING);
dlg.ShowModal();
return;
}
DiffMoranVarSettingDlg VS(project_p);
if (VS.ShowModal() != wxID_OK) {
return;
}
int col_idx = VS.col_ids[0];
if (table_int->GetColType(col_idx, 0) != GdaConst::double_type &&
table_int->GetColType(col_idx, 0) != GdaConst::long64_type) {
wxMessageDialog dlg (this, _("The selected variable is not numeric. Please select another variable."), _("Variable Type Error"), wxOK | wxICON_WARNING);
dlg.ShowModal();
return;
}
boost::uuids::uuid w_id = VS.GetWeightsId();
if (w_id.is_nil())
return;
GalWeight* gw = w_man_int->GetGal(w_id);
if (gw == NULL) {
wxMessageDialog dlg (this, _("Invalid Weights Information:\n\n The selected weights file is not valid.\n Please choose another weights file, or use Tools > Weights > Weights Manager\n to define a valid weights file."), _("Warning"), wxOK | wxICON_WARNING);
dlg.ShowModal();
return;
}
bool cont = true;
for (int i=0; i<p->GetNumRecords(); i++) {
if (gw->gal[i].Size() == 0 ) {
wxMessageDialog dlg (this, _("Moran scatter plot is not supported when isolates are present in weights. Do you want to continue by removing the isolates when compute Moran's I?"), _("Warning"), wxYES_NO | wxICON_WARNING);
if (dlg.ShowModal() == wxID_NO) {
cont = false;
}
break;
}
}
if (!cont) {
return;
}
LisaCoordinator* lc = new LisaCoordinator(w_id, project_p,
VS.var_info, VS.col_ids,
LisaCoordinator::differential,
false);
LisaScatterPlotFrame *f = new LisaScatterPlotFrame(GdaFrame::gda_frame,
project_p, lc);
}
void GdaFrame::OnOpenGMoran(wxCommandEvent& event)
{
wxLogMessage("Open LisaScatterPlotFrame (OnOpenGMoran).");
Project* p = GetProject();
if (!p) return;
std::vector<boost::uuids::uuid> weights_ids;
WeightsManInterface* w_man_int = p->GetWManInt();
w_man_int->GetIds(weights_ids);
if (weights_ids.size()==0) {
wxMessageDialog dlg (this, _("GeoDa could not find the required weights file. \nPlease specify weights in Tools > Weights Manager."), _("No Weights Found"), wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
}
bool show_weights = true;
bool show_distance = false;
wxString title = _("Bivariate Moran Variable Settings");
VariableSettingsDlg VS(project_p, VariableSettingsDlg::bivariate, show_weights, show_distance, title);
if (VS.ShowModal() != wxID_OK)
return;
boost::uuids::uuid w_id = VS.GetWeightsId();
if (w_id.is_nil())
return;
GalWeight* gw = w_man_int->GetGal(w_id);
if (gw == NULL) {
wxMessageDialog dlg (this, _("Invalid Weights Information:\n\n The selected weights file is not valid.\n Please choose another weights file, or use Tools > Weights > Weights Manager\n to define a valid weights file."), _("Warning"), wxOK | wxICON_WARNING);
dlg.ShowModal();
return;
}
bool cont = true;
for (int i=0; i<p->GetNumRecords(); i++) {
if (gw->gal[i].Size() == 0 ) {
wxMessageDialog dlg (this, _("Moran scatter plot is not supported when isolates are present in weights. Do you want to continue by removing the isolates when compute Moran's I?"), _("Warning"), wxYES_NO | wxICON_WARNING);
if (dlg.ShowModal() == wxID_NO) {
cont = false;
}
break;
}
}
if (!cont) {
return;
}
LisaCoordinator* lc = new LisaCoordinator(w_id, project_p,
VS.var_info, VS.col_ids,
LisaCoordinator::bivariate,
false);
LisaScatterPlotFrame *f = new LisaScatterPlotFrame(GdaFrame::gda_frame,
project_p, lc);
}
void GdaFrame::OnOpenMoranEB(wxCommandEvent& event)
{
wxLogMessage("Open LisaScatterPlotFrame (OnOpenMoranEB).");
Project* p = GetProject();
if (!p) return;
std::vector<boost::uuids::uuid> weights_ids;
WeightsManInterface* w_man_int = p->GetWManInt();
w_man_int->GetIds(weights_ids);
if (weights_ids.size()==0) {
wxMessageDialog dlg (this, _("GeoDa could not find the required weights file. \nPlease specify weights in Tools > Weights Manager."), _("No Weights Found"), wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
}
VariableSettingsDlg VS(project_p, VariableSettingsDlg::bivariate, true,
false,
_("Empirical Bayes Rate Standardization Variables"),
_("Event Variable"), _("Base Variable"));
if (VS.ShowModal() != wxID_OK) return;
boost::uuids::uuid w_id = VS.GetWeightsId();
if (w_id.is_nil()) return;
GalWeight* gw = w_man_int->GetGal(w_id);
if (gw == NULL) {
wxMessageDialog dlg (this, _("Invalid Weights Information:\n\n The selected weights file is not valid.\n Please choose another weights file, or use Tools > Weights > Weights Manager\n to define a valid weights file."), _("Warning"), wxOK | wxICON_WARNING);
dlg.ShowModal();
return;
}
bool cont = true;
for (int i=0; i<p->GetNumRecords(); i++) {
if (gw->gal[i].Size() == 0 ) {
wxMessageDialog dlg (this, _("Moran scatter plot is not supported when isolates are present in weights. Do you want to continue by removing the isolates when compute Moran's I?"), _("Warning"), wxYES_NO | wxICON_WARNING);
if (dlg.ShowModal() == wxID_NO) {
cont = false;
}
break;
}
}
if (!cont) {
return;
}
LisaCoordinator* lc = new LisaCoordinator(w_id, project_p,
VS.var_info, VS.col_ids,
LisaCoordinator::eb_rate_standardized,
false);
LisaScatterPlotFrame *f = new LisaScatterPlotFrame(GdaFrame::gda_frame,
project_p, lc);
}
void GdaFrame::OnLisaMenuChoices(wxCommandEvent& WXUNUSED(event))
{
Project* p = GetProject();
if (!p) return;
wxMenu* popupMenu = wxXmlResource::Get()->LoadMenu("ID_LISA_MENU");
if (popupMenu) PopupMenu(popupMenu, wxDefaultPosition);
}
void GdaFrame::OnCorrelogramMenuChoices(wxCommandEvent& WXUNUSED(event))
{
Project* p = GetProject();
if (!p) return;
wxMenu* popupMenu = wxXmlResource::Get()->LoadMenu("ID_CORRELO_MENU");
if (popupMenu) PopupMenu(popupMenu, wxDefaultPosition);
}
void GdaFrame::OnGetisMenuChoices(wxCommandEvent& WXUNUSED(event))
{
Project* p = GetProject();
if (!p) return;
wxMenu* popupMenu = wxXmlResource::Get()->LoadMenu("ID_GETIS_MENU");
if (popupMenu) PopupMenu(popupMenu, wxDefaultPosition);
}
void GdaFrame::OnOpenLocalMatch(wxCommandEvent& event)
{
wxLogMessage("Open OnOpenLocalMatch.");
Project* p = GetProject();
if (!p) return;
FramesManager* fm = p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (NbrMatchDlg* w = dynamic_cast<NbrMatchDlg*>(*it)) {
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
NbrMatchDlg* dlg = new NbrMatchDlg(this, p);
dlg->Show(true);
}
void GdaFrame::OnOpenQuantileLisa(wxCommandEvent& event)
{
wxLogMessage("Open OnOpenMultiQuantileLisa.");
Project* p = GetProject();
if (!p) return;
FramesManager* fm = p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (QuantileLisaDlg* w = dynamic_cast<QuantileLisaDlg*>(*it)) {
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
QuantileLisaDlg* dlg = new QuantileLisaDlg(this, p);
dlg->Show(true);
}
void GdaFrame::OnOpenMultiQuantileLisa(wxCommandEvent& event)
{
wxLogMessage("Open OnOpenMultiQuantileLisa.");
Project* p = GetProject();
if (!p) return;
FramesManager* fm = p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (MultiQuantileLisaDlg* w = dynamic_cast<MultiQuantileLisaDlg*>(*it)) {
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
MultiQuantileLisaDlg* dlg = new MultiQuantileLisaDlg(this, p);
dlg->Show(true);
}
void GdaFrame::OnOpenUniLocalGeary(wxCommandEvent& event)
{
wxLogMessage("Open LocalGearyFrame (OnOpenUniLocalGeary).");
Project* p = GetProject();
if (!p) return;
std::vector<boost::uuids::uuid> weights_ids;
WeightsManInterface* w_man_int = p->GetWManInt();
w_man_int->GetIds(weights_ids);
if (weights_ids.size()==0) {
wxMessageDialog dlg (this, _("GeoDa could not find the required weights file. \nPlease specify weights in Tools > Weights Manager."), _("No Weights Found"), wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
}
VariableSettingsDlg VS(p, VariableSettingsDlg::univariate, true, false);
if (VS.ShowModal() != wxID_OK) return;
boost::uuids::uuid w_id = VS.GetWeightsId();
if (w_id.is_nil()) return;
GalWeight* gw = w_man_int->GetGal(w_id);
if (gw == NULL) {
wxMessageDialog dlg (this, _("Invalid Weights Information:\n\n The selected weights file is not valid.\n Please choose another weights file, or use Tools > Weights > Weights Manager\n to define a valid weights file."), _("Warning"), wxOK | wxICON_WARNING);
dlg.ShowModal();
return;
}
LocalGearyWhat2OpenDlg LWO(this);
if (LWO.ShowModal() != wxID_OK) return;
if (!LWO.m_ClustMap && !LWO.m_SigMap) return;
LocalGearyCoordinator* lc = new LocalGearyCoordinator(w_id, p,
VS.var_info,
VS.col_ids,
LocalGearyCoordinator::univariate,
true, LWO.m_RowStand);
if (LWO.m_ClustMap) {
LocalGearyMapFrame *sf = new LocalGearyMapFrame(GdaFrame::gda_frame, p,
lc, true, false, false);
}
if (LWO.m_SigMap) {
LocalGearyMapFrame *sf = new LocalGearyMapFrame(GdaFrame::gda_frame, p,
lc, false, false, false,
wxDefaultPosition);
}
}
void GdaFrame::OnOpenMultiLocalGeary(wxCommandEvent& event)
{
wxLogMessage("Open LocalGearyFrame (OnOpenMultiLocalGeary).");
Project* p = GetProject();
if (!p) return;
std::vector<boost::uuids::uuid> weights_ids;
WeightsManInterface* w_man_int = p->GetWManInt();
w_man_int->GetIds(weights_ids);
if (weights_ids.size()==0) {
wxMessageDialog dlg (this, _("GeoDa could not find the required weights file. \nPlease specify weights in Tools > Weights Manager."), _("No Weights Found"), wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
}
MultiVariableSettingsDlg VS(p);
if (VS.ShowModal() != wxID_OK) return;
boost::uuids::uuid w_id = VS.GetWeightsId();
if (w_id.is_nil()) return;
GalWeight* gw = w_man_int->GetGal(w_id);
if (gw == NULL) {
wxMessageDialog dlg (this, _("Invalid Weights Information:\n\n The selected weights file is not valid.\n Please choose another weights file, or use Tools > Weights > Weights Manager\n to define a valid weights file."), _("Warning"), wxOK | wxICON_WARNING);
dlg.ShowModal();
return;
}
LocalGearyWhat2OpenDlg LWO(this);
if (LWO.ShowModal() != wxID_OK) return;
if (!LWO.m_ClustMap && !LWO.m_SigMap) return;
LocalGearyCoordinator* lc = new LocalGearyCoordinator(w_id, p,
VS.var_info,
VS.col_ids,
LocalGearyCoordinator::multivariate,
true, LWO.m_RowStand);
if (LWO.m_ClustMap) {
LocalGearyMapFrame *sf = new LocalGearyMapFrame(GdaFrame::gda_frame, p,
lc, true, false, false);
}
if (LWO.m_SigMap) {
LocalGearyMapFrame *sf = new LocalGearyMapFrame(GdaFrame::gda_frame, p,
lc, false, false, false,
wxDefaultPosition);
}
}
void GdaFrame::OnOpenUniLisa(wxCommandEvent& event)
{
wxLogMessage("Open LisaMapFrame (OnOpenUniLisa).");
Project* p = GetProject();
if (!p) return;
std::vector<boost::uuids::uuid> weights_ids;
WeightsManInterface* w_man_int = p->GetWManInt();
w_man_int->GetIds(weights_ids);
if (weights_ids.size()==0) {
wxMessageDialog dlg (this, _("GeoDa could not find the required weights file. \nPlease specify weights in Tools > Weights Manager."), _("No Weights Found"), wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
}
VariableSettingsDlg VS(p, VariableSettingsDlg::univariate, true, false);
if (VS.ShowModal() != wxID_OK) return;
boost::uuids::uuid w_id = VS.GetWeightsId();
if (w_id.is_nil()) return;
GalWeight* gw = w_man_int->GetGal(w_id);
if (gw == NULL) {
wxMessageDialog dlg (this, _("Invalid Weights Information:\n\n The selected weights file is not valid.\n Please choose another weights file, or use Tools > Weights > Weights Manager\n to define a valid weights file."), _("Warning"), wxOK | wxICON_WARNING);
dlg.ShowModal();
return;
}
LisaWhat2OpenDlg LWO(this);
if (LWO.ShowModal() != wxID_OK) return;
if (!LWO.m_ClustMap && !LWO.m_SigMap && !LWO.m_Moran) return;
LisaCoordinator* lc = new LisaCoordinator(w_id, p,
VS.var_info,
VS.col_ids,
LisaCoordinator::univariate,
true, LWO.m_RowStand);
if (LWO.m_Moran) {
LisaScatterPlotFrame *sf = new LisaScatterPlotFrame(GdaFrame::gda_frame,
p, lc);
}
if (LWO.m_ClustMap) {
LisaMapFrame *sf = new LisaMapFrame(GdaFrame::gda_frame, p,
lc, true, false, false);
}
if (LWO.m_SigMap) {
LisaMapFrame *sf = new LisaMapFrame(GdaFrame::gda_frame, p,
lc, false, false, false,
wxDefaultPosition);
}
}
void GdaFrame::OnOpenUniMedianLisa(wxCommandEvent& event)
{
wxLogMessage("Open LisaMapFrame (OnOpenUniMedianLisa).");
Project* p = GetProject();
if (!p) return;
std::vector<boost::uuids::uuid> weights_ids;
WeightsManInterface* w_man_int = p->GetWManInt();
w_man_int->GetIds(weights_ids);
if (weights_ids.size()==0) {
wxMessageDialog dlg (this, _("GeoDa could not find the required weights file. \nPlease specify weights in Tools > Weights Manager."), _("No Weights Found"), wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
}
VariableSettingsDlg VS(p, VariableSettingsDlg::univariate, true, false);
if (VS.ShowModal() != wxID_OK) return;
boost::uuids::uuid w_id = VS.GetWeightsId();
if (w_id.is_nil()) return;
GalWeight* gw = w_man_int->GetGal(w_id);
if (gw == NULL) {
wxMessageDialog dlg (this, _("Invalid Weights Information:\n\n The selected weights file is not valid.\n Please choose another weights file, or use Tools > Weights > Weights Manager\n to define a valid weights file."), _("Warning"), wxOK | wxICON_WARNING);
dlg.ShowModal();
return;
}
LisaWhat2OpenDlg LWO(this);
LWO.HideMoranScatter();
if (LWO.ShowModal() != wxID_OK) return;
if (!LWO.m_ClustMap && !LWO.m_SigMap && !LWO.m_Moran) return;
bool using_median = true;
LisaCoordinator* lc = new LisaCoordinator(w_id, p,
VS.var_info,
VS.col_ids,
LisaCoordinator::univariate,
true, LWO.m_RowStand,
using_median);
if (LWO.m_ClustMap) {
LisaMapFrame *sf = new LisaMapFrame(GdaFrame::gda_frame, p,
lc, true, false, false);
}
if (LWO.m_SigMap) {
LisaMapFrame *sf = new LisaMapFrame(GdaFrame::gda_frame, p,
lc, false, false, false,
wxDefaultPosition);
}
}
void GdaFrame::OnOpenMultiLisa(wxCommandEvent& event)
{
wxLogMessage("Open LisaMapFrame (OnOpenMultiLisa).");
Project* project = GetProject();
if (!project) return;
std::vector<boost::uuids::uuid> weights_ids;
WeightsManInterface* w_man_int = project->GetWManInt();
w_man_int->GetIds(weights_ids);
if (weights_ids.size()==0) {
wxMessageDialog dlg (this, _("GeoDa could not find the required weights file. \nPlease specify weights in Tools > Weights Manager."), _("No Weights Found"), wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
}
VariableSettingsDlg VS(project_p, VariableSettingsDlg::bivariate, true,
false);
if (VS.ShowModal() != wxID_OK) return;
boost::uuids::uuid w_id = VS.GetWeightsId();
if (w_id.is_nil()) return;
GalWeight* gw = w_man_int->GetGal(w_id);
if (gw == NULL) {
wxString msg = _("Invalid Weights Information:\n\n The selected weights file is not valid.\n Please choose another weights file, or use Tools > Weights > Weights Manager to define a valid weights file.");
wxMessageDialog dlg (this, msg, _("Warning"), wxOK | wxICON_WARNING);
dlg.ShowModal();
return;
}
LisaWhat2OpenDlg LWO(this);
if (LWO.ShowModal() != wxID_OK) return;
if (!LWO.m_ClustMap && !LWO.m_SigMap &&!LWO.m_Moran) return;
LisaCoordinator* lc = new LisaCoordinator(w_id, project_p,
VS.var_info,
VS.col_ids,
LisaCoordinator::bivariate,
true, LWO.m_RowStand);
if (LWO.m_Moran) {
LisaScatterPlotFrame *sf = new LisaScatterPlotFrame(GdaFrame::gda_frame,
project_p, lc);
}
if (LWO.m_ClustMap) {
LisaMapFrame *sf = new LisaMapFrame(GdaFrame::gda_frame, project_p,
lc, true, true, false);
}
if (LWO.m_SigMap) {
LisaMapFrame *sf = new LisaMapFrame(GdaFrame::gda_frame, project_p,
lc, false, true, false);
}
}
void GdaFrame::OnOpenDiffLisa(wxCommandEvent& event)
{
wxLogMessage("Open LisaMapFrame (OnOpenDiffLisa).");
Project* p = GetProject();
if (!p) return;
//VariableSettingsDlg VS(project_p, VariableSettingsDlg::bivariate, true, false);
Project* project = GetProject();
TableInterface* table_int = project->GetTableInt();
std::vector<boost::uuids::uuid> weights_ids;
WeightsManInterface* w_man_int = project->GetWManInt();
w_man_int->GetIds(weights_ids);
if (weights_ids.size()==0) {
wxMessageDialog dlg (this, _("GeoDa could not find the required weights file. \nPlease specify weights in Tools > Weights Manager."), _("No Weights Found"), wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
}
bool has_time = table_int->IsTimeVariant();
if (has_time == false) {
wxMessageDialog dlg (this, _("Differential Moran's I tests whether the change in a variable over time is spatially correlated.\n\nPlease first group variables by time period: Select Time --> Time Editor."), _("Warning"), wxOK | wxICON_WARNING);
dlg.ShowModal();
return;
}
DiffMoranVarSettingDlg VS(project_p);
if (VS.ShowModal() != wxID_OK) return;
int col_idx = VS.col_ids[0];
if (table_int->GetColType(col_idx, 0) != GdaConst::double_type &&
table_int->GetColType(col_idx, 0) != GdaConst::long64_type) {
wxString msg = _("The selected variable is not numeric. Please select another variable.");
wxMessageDialog dlg (this, msg, _("Variable Type Error"), wxOK | wxICON_WARNING);
dlg.ShowModal();
return;
}
boost::uuids::uuid w_id = VS.GetWeightsId();
if (w_id.is_nil()) return;
LisaWhat2OpenDlg LWO(this);
if (LWO.ShowModal() != wxID_OK) return;
if (!LWO.m_ClustMap && !LWO.m_SigMap &&!LWO.m_Moran) return;
GalWeight* gw = w_man_int->GetGal(w_id);
if (gw == NULL) {
wxString msg = _("Invalid Weights Information:\n\n The selected weights file is not valid.\n Please choose another weights file, or use Tools > Weights > Weights Manager to define a valid weights file.");
wxMessageDialog dlg (this, msg, _("Warning"), wxOK | wxICON_WARNING);
dlg.ShowModal();
return;
}
LisaCoordinator* lc = new LisaCoordinator(w_id, project_p,
VS.var_info,
VS.col_ids,
LisaCoordinator::differential,
true, LWO.m_RowStand);
if (LWO.m_Moran) {
LisaScatterPlotFrame *sf = new LisaScatterPlotFrame(GdaFrame::gda_frame,
project_p, lc);
}
if (LWO.m_ClustMap) {
LisaMapFrame *sf = new LisaMapFrame(GdaFrame::gda_frame, project_p,
lc, true, false, false);
}
if (LWO.m_SigMap) {
LisaMapFrame *sf = new LisaMapFrame(GdaFrame::gda_frame, project_p,
lc, false, false, false);
}
}
void GdaFrame::OnOpenLisaEB(wxCommandEvent& event)
{
wxLogMessage("Open LisaMapFrame (OnOpenLisaEB).");
Project* p = GetProject();
if (!p) return;
std::vector<boost::uuids::uuid> weights_ids;
WeightsManInterface* w_man_int = p->GetWManInt();
w_man_int->GetIds(weights_ids);
if (weights_ids.size()==0) {
wxString msg = _("GeoDa could not find the required weights file. \nPlease specify weights in Tools > Weights Manager.");
wxMessageDialog dlg (this, msg, _("No Weights Found"), wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
}
// Note: this is the only call to this particular constructor
VariableSettingsDlg VS(project_p, VariableSettingsDlg::bivariate,
true,false,
_("Rates Variable Settings"),
_("Event Variable"), _("Base Variable"));
if (VS.ShowModal() != wxID_OK) return;
boost::uuids::uuid w_id = VS.GetWeightsId();
if (w_id.is_nil()) return;
GalWeight* gw = w_man_int->GetGal(w_id);
if (gw == NULL) {
wxString msg = _("Invalid Weights Information:\n\n The selected weights file is not valid.\n Please choose another weights file, or use Tools > Weights > Weights Manager to define a valid weights file.");
wxMessageDialog dlg (this, msg, _("Warning"), wxOK | wxICON_WARNING);
dlg.ShowModal();
return;
}
LisaWhat2OpenDlg LWO(this);
if (LWO.ShowModal() != wxID_OK) return;
if (!LWO.m_ClustMap && !LWO.m_Moran && !LWO.m_SigMap) return;
LisaCoordinator* lc = new LisaCoordinator(w_id, project_p,
VS.var_info,
VS.col_ids,
LisaCoordinator::eb_rate_standardized,
true, LWO.m_RowStand);
if (LWO.m_Moran) {
LisaScatterPlotFrame *sf = new LisaScatterPlotFrame(GdaFrame::gda_frame,
project_p, lc);
}
if (LWO.m_ClustMap) {
LisaMapFrame *sf = new LisaMapFrame(GdaFrame::gda_frame, project_p,
lc, true, false, true);
}
if (LWO.m_SigMap) {
LisaMapFrame *sf = new LisaMapFrame(GdaFrame::gda_frame, project_p,
lc, false, false, true);
}
}
void GdaFrame::OnOpenLocalJoinCount(wxCommandEvent& event)
{
wxLogMessage("Open OnOpenLocalJoinCount().");
Project* p = GetProject();
if (!p) return;
std::vector<boost::uuids::uuid> weights_ids;
WeightsManInterface* w_man_int = p->GetWManInt();
w_man_int->GetIds(weights_ids);
if (weights_ids.size()==0) {
wxString msg = _("GeoDa could not find the required weights file. \nPlease specify weights in Tools > Weights Manager.");
wxMessageDialog dlg (this, msg, _("No Weights Found"), wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
}
VariableSettingsDlg VS(project_p, VariableSettingsDlg::univariate, true, false, "Binary Variable Settings");
if (VS.ShowModal() != wxID_OK) return;
boost::uuids::uuid w_id = VS.GetWeightsId();
if (w_id.is_nil()) return;
GalWeight* gw = w_man_int->GetGal(w_id);
if (gw == NULL) {
wxString msg = _("Invalid Weights Information:\n\n The selected weights file is not valid.\n Please choose another weights file, or use Tools > Weights > Weights Manager to define a valid weights file.");
wxMessageDialog dlg (this, msg, _("Warning"), wxOK | wxICON_WARNING);
dlg.ShowModal();
return;
}
// check if binary data
std::vector<double> data;
TableInterface* table_int = p->GetTableInt();
table_int->GetColData(VS.col_ids[0], VS.var_info[0].time, data);
for (int i=0; i<data.size(); i++) {
if (data[i] !=0 && data[i] != 1) {
wxString msg = _("Please select a binary variable for Local Join Count.");
wxMessageDialog dlg (this, msg, _("Warning"), wxOK | wxICON_WARNING);
dlg.ShowModal();
return;
}
}
JCCoordinator* lc = new JCCoordinator(w_id, p, VS.var_info, VS.col_ids);
MLJCMapFrame *sf = new MLJCMapFrame(GdaFrame::gda_frame, p, lc, false);
}
void GdaFrame::OnOpenBivariateLJC(wxCommandEvent& event)
{
wxLogMessage("Enter OnOpenBivariateLJC()");
Project* p = GetProject();
if (!p) return;
std::vector<boost::uuids::uuid> weights_ids;
WeightsManInterface* w_man_int = p->GetWManInt();
w_man_int->GetIds(weights_ids);
if (weights_ids.size()==0) {
wxMessageDialog dlg (this, _("GeoDa could not find the required weights file. \nPlease specify weights in Tools > Weights Manager."), _("No Weights Found"), wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
}
VariableSettingsDlg VS(project_p, VariableSettingsDlg::bivariate, true, false);
if (VS.ShowModal() != wxID_OK) return;
boost::uuids::uuid w_id = VS.GetWeightsId();
if (w_id.is_nil()) return;
GalWeight* gw = w_man_int->GetGal(w_id);
if (gw == NULL) {
wxMessageDialog dlg (this, _("Invalid Weights Information:\n\n The selected weights file is not valid.\n Please choose another weights file, or use Tools > Weights > Weights Manager\n to define a valid weights file."), _("Warning"), wxOK | wxICON_WARNING);
dlg.ShowModal();
return;
}
// check if binary data
std::vector<double> data;
TableInterface* table_int = p->GetTableInt();
table_int->GetColData(VS.col_ids[0], VS.var_info[0].time, data);
for (int i=0; i<data.size(); i++) {
if (data[i] !=0 && data[i] != 1) {
wxString msg = _("Please select two binary variables for Bivariate Local Join Count.");
wxMessageDialog dlg (this, msg, _("Warning"), wxOK | wxICON_WARNING);
dlg.ShowModal();
return;
}
}
table_int->GetColData(VS.col_ids[1], VS.var_info[1].time, data);
for (int i=0; i<data.size(); i++) {
if (data[i] !=0 && data[i] != 1) {
wxString msg = _("Please select two binary variables for Bivariate Local Join Count.");
wxMessageDialog dlg (this, msg, _("Warning"), wxOK | wxICON_WARNING);
dlg.ShowModal();
return;
}
}
JCCoordinator* lc = new JCCoordinator(w_id, p, VS.var_info, VS.col_ids);
MLJCMapFrame *sf = new MLJCMapFrame(GdaFrame::gda_frame, p, lc, false);
}
void GdaFrame::OnOpenMultiLJC(wxCommandEvent& event)
{
wxLogMessage("Open OnOpenMultiLJC (OnOpenMultiLJC).");
Project* p = GetProject();
if (!p) return;
std::vector<boost::uuids::uuid> weights_ids;
WeightsManInterface* w_man_int = p->GetWManInt();
w_man_int->GetIds(weights_ids);
if (weights_ids.size()==0) {
wxMessageDialog dlg (this, _("GeoDa could not find the required weights file. \nPlease specify weights in Tools > Weights Manager."), _("No Weights Found"), wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
}
MultiVariableSettingsDlg VS(p);
if (VS.ShowModal() != wxID_OK) return;
boost::uuids::uuid w_id = VS.GetWeightsId();
if (w_id.is_nil()) return;
GalWeight* gw = w_man_int->GetGal(w_id);
if (gw == NULL) {
wxMessageDialog dlg (this, _("Invalid Weights Information:\n\n The selected weights file is not valid.\n Please choose another weights file, or use Tools > Weights > Weights Manager\n to define a valid weights file."), _("Warning"), wxOK | wxICON_WARNING);
dlg.ShowModal();
return;
}
int num_vars = VS.var_info.size();
// check if binary data
std::vector<double> data;
TableInterface* table_int = p->GetTableInt();
for (int c=0; c<num_vars; c++) {
table_int->GetColData(VS.col_ids[c], VS.var_info[c].time, data);
for (int i=0; i<data.size(); i++) {
if (data[i] !=0 && data[i] != 1) {
wxString msg = _("Please select binary variables for Co-location Join Count.");
wxMessageDialog dlg (this, msg, _("Warning"), wxOK | wxICON_WARNING);
dlg.ShowModal();
return;
}
}
}
// check if more than 2 variables has colocation
if (num_vars > 2) {
std::vector<d_array_type> data(num_vars); // data[variable][time][obs]
std::vector<b_array_type> undef_data(num_vars);
for (int i=0; i<VS.var_info.size(); i++) {
table_int->GetColData(VS.col_ids[i], data[i]);
table_int->GetColUndefined(VS.col_ids[i], undef_data[i]);
}
GalElement* W = gw->gal;
int t = 0;
int num_obs = p->GetNumRecords();
if (p->GetTimeState()) t = p->GetTimeState()->GetCurrTime();
vector<int> local_t;
for (int v=0; v<num_vars; v++) {
if (data[v].size()==1) {
local_t.push_back(0);
} else {
local_t.push_back(t);
}
}
vector<bool> undefs;
for (int i=0; i<num_obs; i++){
bool is_undef = false;
for (int v=0; v<undef_data.size(); v++) {
for (int var_t=0; var_t<undef_data[v].size(); var_t++){
is_undef = is_undef || undef_data[v][var_t][i];
}
}
undefs.push_back(is_undef);
}
int* zz = new int[num_obs];
for (int i=0; i<num_obs; i++) zz[i] = 1;
for (int i=0; i<num_obs; i++) {
if (undefs[i] == true) {
zz[i] = 0;
continue;
}
for (int v=0; v<num_vars; v++) {
int _t = local_t[v];
int _v = data[v][_t][i];
zz[i] = zz[i] * _v;
}
}
int sum = 0;
for (int i=0; i<num_obs; i++) {
sum += zz[i];
}
bool nocolocation = sum == 0;
if (nocolocation) {
wxMessageDialog dlg (this, _("Co-location Join Count only applies to co-location case. The selected variables have no co-location. Please change your selection, or use Univariate/Bivariate Local Join Count."), _("Error"), wxOK | wxICON_WARNING);
dlg.ShowModal();
return;
}
}
JCCoordinator* lc = new JCCoordinator(w_id, p, VS.var_info, VS.col_ids);
MLJCMapFrame *sf = new MLJCMapFrame(GdaFrame::gda_frame, p, lc, false);
}
void GdaFrame::OnOpenGetisOrdStar(wxCommandEvent& event)
{
wxLogMessage("Open GetisOrdMapFrame (OnOpenGetisOrdStar).");
Project* p = GetProject();
if (!p) return;
std::vector<boost::uuids::uuid> weights_ids;
WeightsManInterface* w_man_int = p->GetWManInt();
w_man_int->GetIds(weights_ids);
if (weights_ids.size()==0) {
wxString msg = _("GeoDa could not find the required weights file. \nPlease specify weights in Tools > Weights Manager.");
wxMessageDialog dlg (this, msg, "No Weights Found", wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
}
VariableSettingsDlg VS(project_p, VariableSettingsDlg::univariate, true, false);
if (VS.ShowModal() != wxID_OK) return;
boost::uuids::uuid w_id = VS.GetWeightsId();
if (w_id.is_nil()) return;
GalWeight* gw = w_man_int->GetGal(w_id);
if (gw == NULL) {
wxString msg = _("Invalid Weights Information:\n\n The selected weights file is not valid.\n Please choose another weights file, or use Tools > Weights > Weights Manager to define a valid weights file.");
wxMessageDialog dlg (this, msg, _("Warning"), wxOK | wxICON_WARNING);
dlg.ShowModal();
return;
}
GetisWhat2OpenDlg LWO(this);
if (LWO.ShowModal() != wxID_OK) return;
if (!LWO.m_ClustMap && !LWO.m_SigMap) return;
GStatCoordinator* gc = new GStatCoordinator(w_id, project_p, VS.var_info, VS.col_ids, LWO.m_RowStand);
if (!gc || !gc->IsOk()) {
// print error message
delete gc;
return;
}
if (LWO.m_NormMap && LWO.m_ClustMap) {
GetisOrdMapFrame* f = new GetisOrdMapFrame(this, project_p, gc, GetisOrdMapFrame::GiStar_clus_norm, LWO.m_RowStand);
}
if (LWO.m_NormMap && LWO.m_SigMap) {
GetisOrdMapFrame* f = new GetisOrdMapFrame(this, project_p, gc, GetisOrdMapFrame::GiStar_sig_norm, LWO.m_RowStand);
}
if (!LWO.m_NormMap && LWO.m_ClustMap) {
GetisOrdMapFrame* f = new GetisOrdMapFrame(this, project_p, gc, GetisOrdMapFrame::GiStar_clus_perm, LWO.m_RowStand);
}
if (!LWO.m_NormMap && LWO.m_SigMap) {
GetisOrdMapFrame* f = new GetisOrdMapFrame(this, project_p, gc,GetisOrdMapFrame::GiStar_sig_perm, LWO.m_RowStand);
}
}
void GdaFrame::OnOpenGetisOrd(wxCommandEvent& event)
{
wxLogMessage("Open GetisOrdMapFrame (OnOpenGetisOrd).");
Project* p = GetProject();
if (!p) return;
std::vector<boost::uuids::uuid> weights_ids;
WeightsManInterface* w_man_int = p->GetWManInt();
w_man_int->GetIds(weights_ids);
if (weights_ids.size()==0) {
wxString msg = _("GeoDa could not find the required weights file. \nPlease specify weights in Tools > Weights Manager.");
wxMessageDialog dlg (this, msg, "No Weights Found", wxOK | wxICON_ERROR);
dlg.ShowModal();
return;
}
VariableSettingsDlg VS(project_p, VariableSettingsDlg::univariate, true, false);
if (VS.ShowModal() != wxID_OK) return;
boost::uuids::uuid w_id = VS.GetWeightsId();
if (w_id.is_nil()) return;
GalWeight* gw = w_man_int->GetGal(w_id);
if (gw == NULL) {
wxString msg = _("Invalid Weights Information:\n\n The selected weights file is not valid.\n Please choose another weights file, or use Tools > Weights > Weights Manager to define a valid weights file.");
wxMessageDialog dlg (this, msg, _("Warning"), wxOK | wxICON_WARNING);
dlg.ShowModal();
return;
}
GetisWhat2OpenDlg LWO(this);
if (LWO.ShowModal() != wxID_OK) return;
if (!LWO.m_ClustMap && !LWO.m_SigMap) return;
GStatCoordinator* gc = new GStatCoordinator(w_id, project_p,
VS.var_info, VS.col_ids,
LWO.m_RowStand);
if (!gc || !gc->IsOk()) {
// print error message
delete gc;
return;
}
if (LWO.m_NormMap && LWO.m_ClustMap) {
GetisOrdMapFrame* f = new GetisOrdMapFrame(this, project_p, gc,
GetisOrdMapFrame::Gi_clus_norm,
LWO.m_RowStand);
}
if (LWO.m_NormMap && LWO.m_SigMap) {
GetisOrdMapFrame* f = new GetisOrdMapFrame(this, project_p, gc,
GetisOrdMapFrame::Gi_sig_norm,
LWO.m_RowStand);
}
if (!LWO.m_NormMap && LWO.m_ClustMap) {
GetisOrdMapFrame* f = new GetisOrdMapFrame(this, project_p, gc,
GetisOrdMapFrame::Gi_clus_perm,
LWO.m_RowStand);
}
if (!LWO.m_NormMap && LWO.m_SigMap) {
GetisOrdMapFrame* f = new GetisOrdMapFrame(this, project_p, gc,
GetisOrdMapFrame::Gi_sig_perm,
LWO.m_RowStand);
}
}
void GdaFrame::OnNewCustomCatClassifA(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnNewCustomCatClassifA()");
Project* p = GetProject();
if (!p) return;
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ConditionalMapFrame* f = dynamic_cast<ConditionalMapFrame*>(t)) {
f->OnNewCustomCatClassifA();
} else if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnNewCustomCatClassifA();
} else if (PCPFrame* f = dynamic_cast<PCPFrame*>(t)) {
f->OnNewCustomCatClassifA();
} else if (CartogramNewFrame* f = dynamic_cast<CartogramNewFrame*>(t)) {
f->OnNewCustomCatClassifA();
} else if (ScatterNewPlotFrame* f = dynamic_cast<ScatterNewPlotFrame*>(t)) {
f->OnNewCustomCatClassifA();
}
}
void GdaFrame::OnNewCustomCatClassifB(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnNewCustomCatClassifB()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ConditionalNewFrame* f = dynamic_cast<ConditionalNewFrame*>(t)) {
f->OnNewCustomCatClassifB();
}
}
void GdaFrame::OnNewCustomCatClassifC(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnNewCustomCatClassifC()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ConditionalNewFrame* f = dynamic_cast<ConditionalNewFrame*>(t)) {
f->OnNewCustomCatClassifC();
}
}
void GdaFrame::OnCCClassifA(int cc_menu_num)
{
wxLogMessage("In GdaFrame::OnCCClassifA()");
CatClassifManager* ccm = project_p->GetCatClassifManager();
if (!ccm) return;
std::vector<wxString> titles;
ccm->GetTitles(titles);
if (cc_menu_num < 0 || cc_menu_num >= (int)titles.size()) return;
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ConditionalNewFrame* f = dynamic_cast<ConditionalNewFrame*>(t)) {
f->OnCustomCatClassifA(titles[cc_menu_num]);
} else if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnCustomCatClassifA(titles[cc_menu_num]);
} else if (PCPFrame* f = dynamic_cast<PCPFrame*>(t)) {
f->OnCustomCatClassifA(titles[cc_menu_num]);
} else if (CartogramNewFrame* f = dynamic_cast<CartogramNewFrame*>(t)) {
f->OnCustomCatClassifA(titles[cc_menu_num]);
} else if (ScatterNewPlotFrame* f = dynamic_cast<ScatterNewPlotFrame*>(t)) {
f->OnCustomCatClassifA(titles[cc_menu_num]);
}
}
void GdaFrame::OnCustomCategoryClick_B(wxCommandEvent& event)
{
int xrc_id = event.GetId();
if (project_p) {
CatClassifManager* ccm = project_p->GetCatClassifManager();
if (!ccm) return;
vector<wxString> titles;
ccm->GetTitles(titles);
int idx = xrc_id - GdaConst::ID_CUSTOM_CAT_CLASSIF_CHOICE_B0;
if (idx < 0 || idx >= titles.size()) return;
OnCCClassifB(idx);
}
}
void GdaFrame::OnCustomCategoryClick_C(wxCommandEvent& event)
{
int xrc_id = event.GetId();
if (project_p) {
CatClassifManager* ccm = project_p->GetCatClassifManager();
if (!ccm) return;
vector<wxString> titles;
ccm->GetTitles(titles);
int idx = xrc_id - GdaConst::ID_CUSTOM_CAT_CLASSIF_CHOICE_C0;
if (idx < 0 || idx >= titles.size()) return;
OnCCClassifC(idx);
}
}
void GdaFrame::OnCCClassifB(int cc_menu_num)
{
wxLogMessage("In GdaFrame::OnCCClassifB()");
CatClassifManager* ccm = project_p->GetCatClassifManager();
if (!ccm) return;
std::vector<wxString> titles;
ccm->GetTitles(titles);
if (cc_menu_num < 0 || cc_menu_num >= (int)titles.size()) return;
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ConditionalNewFrame* f = dynamic_cast<ConditionalNewFrame*>(t)) {
f->OnCustomCatClassifB(titles[cc_menu_num]);
}
}
void GdaFrame::OnCCClassifC(int cc_menu_num)
{
wxLogMessage("In GdaFrame::OnCCClassifC()");
CatClassifManager* ccm = project_p->GetCatClassifManager();
if (!ccm) return;
std::vector<wxString> titles;
ccm->GetTitles(titles);
if (cc_menu_num < 0 || cc_menu_num >= (int)titles.size()) return;
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ConditionalNewFrame* f = dynamic_cast<ConditionalNewFrame*>(t)) {
f->OnCustomCatClassifC(titles[cc_menu_num]);
}
}
void GdaFrame::OnOpenThemelessMap(wxCommandEvent& event)
{
wxLogMessage("Open Themeless Map (OnOpenThemelessMap).");
std::vector<int> col_ids;
std::vector<GdaVarTools::VarInfo> var_info;
MapFrame* nf = new MapFrame(GdaFrame::gda_frame, project_p,
var_info, col_ids,
CatClassification::no_theme,
MapCanvas::no_smoothing, 1,
boost::uuids::nil_uuid(),
wxDefaultPosition,
GdaConst::map_default_size);
nf->UpdateTitle();
}
void GdaFrame::OnThemelessMap(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnThemelessMap()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) return;
if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnThemelessMap();
} else if (ScatterNewPlotFrame* f = dynamic_cast<ScatterNewPlotFrame*>(t)) {
f->OnThemeless();
} else if (PCPFrame* f = dynamic_cast<PCPFrame*>(t)) {
f->OnThemeless();
} else if (CartogramNewFrame* f = dynamic_cast<CartogramNewFrame*>(t)) {
f->OnThemeless();
} else if (ConditionalMapFrame* f = dynamic_cast<ConditionalMapFrame*>(t)) {
f->OnThemeless();
}
}
void GdaFrame::OnOpenQuantile1(wxCommandEvent& e) { OpenQuantile(1); }
void GdaFrame::OnOpenQuantile2(wxCommandEvent& e) { OpenQuantile(2); }
void GdaFrame::OnOpenQuantile3(wxCommandEvent& e) { OpenQuantile(3); }
void GdaFrame::OnOpenQuantile4(wxCommandEvent& e) { OpenQuantile(4); }
void GdaFrame::OnOpenQuantile5(wxCommandEvent& e) { OpenQuantile(5); }
void GdaFrame::OnOpenQuantile6(wxCommandEvent& e) { OpenQuantile(6); }
void GdaFrame::OnOpenQuantile7(wxCommandEvent& e) { OpenQuantile(7); }
void GdaFrame::OnOpenQuantile8(wxCommandEvent& e) { OpenQuantile(8); }
void GdaFrame::OnOpenQuantile9(wxCommandEvent& e) { OpenQuantile(9); }
void GdaFrame::OnOpenQuantile10(wxCommandEvent& e) { OpenQuantile(10); }
void GdaFrame::OpenQuantile(int num_cats)
{
wxLogMessage(wxString::Format("In GdaFrame::OpenQuantile(%d)", num_cats));
VariableSettingsDlg dlg(project_p, VariableSettingsDlg::univariate);
if (dlg.ShowModal() != wxID_OK) return;
MapFrame* nf = new MapFrame(GdaFrame::gda_frame, project_p,
dlg.var_info, dlg.col_ids,
CatClassification::quantile,
MapCanvas::no_smoothing, num_cats,
boost::uuids::nil_uuid(),
wxDefaultPosition,
GdaConst::map_default_size);
nf->UpdateTitle();
}
void GdaFrame::OnQuantile1(wxCommandEvent& e) { ChangeToQuantile(1); }
void GdaFrame::OnQuantile2(wxCommandEvent& e) { ChangeToQuantile(2); }
void GdaFrame::OnQuantile3(wxCommandEvent& e) { ChangeToQuantile(3); }
void GdaFrame::OnQuantile4(wxCommandEvent& e) { ChangeToQuantile(4); }
void GdaFrame::OnQuantile5(wxCommandEvent& e) { ChangeToQuantile(5); }
void GdaFrame::OnQuantile6(wxCommandEvent& e) { ChangeToQuantile(6); }
void GdaFrame::OnQuantile7(wxCommandEvent& e) { ChangeToQuantile(7); }
void GdaFrame::OnQuantile8(wxCommandEvent& e) { ChangeToQuantile(8); }
void GdaFrame::OnQuantile9(wxCommandEvent& e) { ChangeToQuantile(9); }
void GdaFrame::OnQuantile10(wxCommandEvent& e) { ChangeToQuantile(10); }
void GdaFrame::ChangeToQuantile(int num_cats)
{
wxLogMessage(wxString::Format("In GdaFrame::ChangeToQuantile(%d)", num_cats));
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
wxCommandEvent event;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) return;
if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnQuantile(num_cats);
} else if (ScatterNewPlotFrame* f = dynamic_cast<ScatterNewPlotFrame*>(t)) {
f->OnQuantile(num_cats);
} else if (PCPFrame* f = dynamic_cast<PCPFrame*>(t)) {
f->OnQuantile(num_cats);
} else if (CartogramNewFrame* f = dynamic_cast<CartogramNewFrame*>(t)) {
f->OnQuantile(num_cats);
} else if (ConditionalMapFrame* f = dynamic_cast<ConditionalMapFrame*>(t)) {
f->OnQuantile(num_cats);
}
}
void GdaFrame::OnOpenPercentile(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnOpenPercentile()");
VariableSettingsDlg dlg(project_p, VariableSettingsDlg::univariate);
if (dlg.ShowModal() != wxID_OK) return;
MapFrame* nf = new MapFrame(GdaFrame::gda_frame, project_p,
dlg.var_info, dlg.col_ids,
CatClassification::percentile,
MapCanvas::no_smoothing, 6,
boost::uuids::nil_uuid(),
wxDefaultPosition,
GdaConst::map_default_size);
nf->UpdateTitle();
}
void GdaFrame::OnPercentile(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnPercentile()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) return;
if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnPercentile();
} else if (ScatterNewPlotFrame* f = dynamic_cast<ScatterNewPlotFrame*>(t)) {
f->OnPercentile();
} else if (PCPFrame* f = dynamic_cast<PCPFrame*>(t)) {
f->OnPercentile();
} else if (CartogramNewFrame* f = dynamic_cast<CartogramNewFrame*>(t)) {
f->OnPercentile();
} else if (ConditionalMapFrame* f = dynamic_cast<ConditionalMapFrame*>(t)) {
f->OnPercentile();
}
}
void GdaFrame::OnOpenHinge15(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnOpenHinge15()");
VariableSettingsDlg dlg(project_p, VariableSettingsDlg::univariate);
if (dlg.ShowModal() != wxID_OK) return;
MapFrame* nf = new MapFrame(GdaFrame::gda_frame, project_p,
dlg.var_info, dlg.col_ids,
CatClassification::hinge_15,
MapCanvas::no_smoothing, 6,
boost::uuids::nil_uuid(),
wxDefaultPosition,
GdaConst::map_default_size);
nf->UpdateTitle();
}
void GdaFrame::OnHinge15(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnHinge15()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) return;
if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) return;
if (BoxPlotFrame* f = dynamic_cast<BoxPlotFrame*>(t)) {
f->OnHinge15(event);
} else if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnHinge15();
} else if (ScatterNewPlotFrame* f = dynamic_cast<ScatterNewPlotFrame*>(t)) {
f->OnHinge15();
} else if (PCPFrame* f = dynamic_cast<PCPFrame*>(t)) {
f->OnHinge15();
} else if (CartogramNewFrame* f = dynamic_cast<CartogramNewFrame*>(t)) {
f->OnHinge15();
} else if (ConditionalMapFrame* f = dynamic_cast<ConditionalMapFrame*>(t)) {
f->OnHinge15();
}
}
void GdaFrame::OnOpenHinge30(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnOpenHinge30()");
VariableSettingsDlg dlg(project_p, VariableSettingsDlg::univariate);
if (dlg.ShowModal() != wxID_OK) return;
MapFrame* nf = new MapFrame(GdaFrame::gda_frame, project_p,
dlg.var_info, dlg.col_ids,
CatClassification::hinge_30,
MapCanvas::no_smoothing, 6,
boost::uuids::nil_uuid(),
wxDefaultPosition,
GdaConst::map_default_size);
nf->UpdateTitle();
}
void GdaFrame::OnHinge30(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnHinge30()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) return;
if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) return;
if (BoxPlotFrame* f = dynamic_cast<BoxPlotFrame*>(t)) {
f->OnHinge30(event);
} else if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnHinge30();
} else if (ScatterNewPlotFrame* f = dynamic_cast<ScatterNewPlotFrame*>(t)) {
f->OnHinge30();
} else if (PCPFrame* f = dynamic_cast<PCPFrame*>(t)) {
f->OnHinge30();
} else if (CartogramNewFrame* f = dynamic_cast<CartogramNewFrame*>(t)) {
f->OnHinge30();
} else if (ConditionalMapFrame* f = dynamic_cast<ConditionalMapFrame*>(t)) {
f->OnHinge30();
}
}
void GdaFrame::OnOpenStddev(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnOpenStddev()");
VariableSettingsDlg dlg(project_p, VariableSettingsDlg::univariate);
if (dlg.ShowModal() != wxID_OK) return;
MapFrame* nf = new MapFrame(GdaFrame::gda_frame, project_p,
dlg.var_info, dlg.col_ids,
CatClassification::stddev,
MapCanvas::no_smoothing, 6,
boost::uuids::nil_uuid(),
wxDefaultPosition,
GdaConst::map_default_size);
nf->UpdateTitle();
}
void GdaFrame::OnStddev(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnStddev()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) return;
if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnStdDevMap();
} else if (ScatterNewPlotFrame* f = dynamic_cast<ScatterNewPlotFrame*>(t)) {
f->OnStdDevMap();
} else if (PCPFrame* f = dynamic_cast<PCPFrame*>(t)) {
f->OnStdDevMap();
} else if (CartogramNewFrame* f = dynamic_cast<CartogramNewFrame*>(t)) {
f->OnStdDevMap();
} else if (ConditionalMapFrame* f = dynamic_cast<ConditionalMapFrame*>(t)) {
f->OnStdDevMap();
}
}
void GdaFrame::OnOpenNaturalBreaks1(wxCommandEvent& e) { OpenNaturalBreaks(1); }
void GdaFrame::OnOpenNaturalBreaks2(wxCommandEvent& e) { OpenNaturalBreaks(2); }
void GdaFrame::OnOpenNaturalBreaks3(wxCommandEvent& e) { OpenNaturalBreaks(3); }
void GdaFrame::OnOpenNaturalBreaks4(wxCommandEvent& e) { OpenNaturalBreaks(4); }
void GdaFrame::OnOpenNaturalBreaks5(wxCommandEvent& e) { OpenNaturalBreaks(5); }
void GdaFrame::OnOpenNaturalBreaks6(wxCommandEvent& e) { OpenNaturalBreaks(6); }
void GdaFrame::OnOpenNaturalBreaks7(wxCommandEvent& e) { OpenNaturalBreaks(7); }
void GdaFrame::OnOpenNaturalBreaks8(wxCommandEvent& e) { OpenNaturalBreaks(8); }
void GdaFrame::OnOpenNaturalBreaks9(wxCommandEvent& e) { OpenNaturalBreaks(9); }
void GdaFrame::OnOpenNaturalBreaks10(wxCommandEvent& e) {OpenNaturalBreaks(10);}
void GdaFrame::OpenNaturalBreaks(int num_cats)
{
wxLogMessage(wxString::Format("In GdaFrame::OpenNaturalBreaks(%d)", num_cats));
VariableSettingsDlg dlg(project_p, VariableSettingsDlg::univariate);
if (dlg.ShowModal() != wxID_OK) return;
MapFrame* nf = new MapFrame(GdaFrame::gda_frame, project_p,
dlg.var_info, dlg.col_ids,
CatClassification::natural_breaks,
MapCanvas::no_smoothing, num_cats,
boost::uuids::nil_uuid(),
wxDefaultPosition,
GdaConst::map_default_size);
nf->UpdateTitle();
}
void GdaFrame::OnNaturalBreaks1(wxCommandEvent& e) { ChangeToNaturalBreaks(1); }
void GdaFrame::OnNaturalBreaks2(wxCommandEvent& e) { ChangeToNaturalBreaks(2); }
void GdaFrame::OnNaturalBreaks3(wxCommandEvent& e) { ChangeToNaturalBreaks(3); }
void GdaFrame::OnNaturalBreaks4(wxCommandEvent& e) { ChangeToNaturalBreaks(4); }
void GdaFrame::OnNaturalBreaks5(wxCommandEvent& e) { ChangeToNaturalBreaks(5); }
void GdaFrame::OnNaturalBreaks6(wxCommandEvent& e) { ChangeToNaturalBreaks(6); }
void GdaFrame::OnNaturalBreaks7(wxCommandEvent& e) { ChangeToNaturalBreaks(7); }
void GdaFrame::OnNaturalBreaks8(wxCommandEvent& e) { ChangeToNaturalBreaks(8); }
void GdaFrame::OnNaturalBreaks9(wxCommandEvent& e) { ChangeToNaturalBreaks(9); }
void GdaFrame::OnNaturalBreaks10(wxCommandEvent& e) {ChangeToNaturalBreaks(10);}
void GdaFrame::ChangeToNaturalBreaks(int num_cats)
{
wxLogMessage(wxString::Format("In GdaFrame::ChangeToNaturalBreaks(%d)", num_cats));
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
wxCommandEvent event;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) return;
if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnNaturalBreaks(num_cats);
} else if (ScatterNewPlotFrame* f = dynamic_cast<ScatterNewPlotFrame*>(t)) {
f->OnNaturalBreaks(num_cats);
} else if (PCPFrame* f = dynamic_cast<PCPFrame*>(t)) {
f->OnNaturalBreaks(num_cats);
} else if (CartogramNewFrame* f = dynamic_cast<CartogramNewFrame*>(t)) {
f->OnNaturalBreaks(num_cats);
} else if (ConditionalMapFrame* f = dynamic_cast<ConditionalMapFrame*>(t)) {
f->OnNaturalBreaks(num_cats);
}
}
void GdaFrame::OnOpenEqualIntervals1(wxCommandEvent& e)
{ OpenEqualIntervals(1); }
void GdaFrame::OnOpenEqualIntervals2(wxCommandEvent& e)
{ OpenEqualIntervals(2); }
void GdaFrame::OnOpenEqualIntervals3(wxCommandEvent& e)
{ OpenEqualIntervals(3); }
void GdaFrame::OnOpenEqualIntervals4(wxCommandEvent& e)
{ OpenEqualIntervals(4); }
void GdaFrame::OnOpenEqualIntervals5(wxCommandEvent& e)
{ OpenEqualIntervals(5); }
void GdaFrame::OnOpenEqualIntervals6(wxCommandEvent& e)
{ OpenEqualIntervals(6); }
void GdaFrame::OnOpenEqualIntervals7(wxCommandEvent& e)
{ OpenEqualIntervals(7); }
void GdaFrame::OnOpenEqualIntervals8(wxCommandEvent& e)
{ OpenEqualIntervals(8); }
void GdaFrame::OnOpenEqualIntervals9(wxCommandEvent& e)
{ OpenEqualIntervals(9); }
void GdaFrame::OnOpenEqualIntervals10(wxCommandEvent& e)
{ OpenEqualIntervals(10); }
void GdaFrame::OpenEqualIntervals(int num_cats)
{
wxLogMessage(wxString::Format("In GdaFrame::OpenEqualIntervals(%d)", num_cats));
VariableSettingsDlg dlg(project_p, VariableSettingsDlg::univariate);
if (dlg.ShowModal() != wxID_OK) return;
MapFrame* nf = new MapFrame(GdaFrame::gda_frame, project_p,
dlg.var_info, dlg.col_ids,
CatClassification::equal_intervals,
MapCanvas::no_smoothing, num_cats,
boost::uuids::nil_uuid(),
wxDefaultPosition,
GdaConst::map_default_size);
nf->UpdateTitle();
}
void GdaFrame::OnEqualIntervals1(wxCommandEvent& e)
{ ChangeToEqualIntervals(1); }
void GdaFrame::OnEqualIntervals2(wxCommandEvent& e)
{ ChangeToEqualIntervals(2); }
void GdaFrame::OnEqualIntervals3(wxCommandEvent& e)
{ ChangeToEqualIntervals(3); }
void GdaFrame::OnEqualIntervals4(wxCommandEvent& e)
{ ChangeToEqualIntervals(4); }
void GdaFrame::OnEqualIntervals5(wxCommandEvent& e)
{ ChangeToEqualIntervals(5); }
void GdaFrame::OnEqualIntervals6(wxCommandEvent& e)
{ ChangeToEqualIntervals(6); }
void GdaFrame::OnEqualIntervals7(wxCommandEvent& e)
{ ChangeToEqualIntervals(7); }
void GdaFrame::OnEqualIntervals8(wxCommandEvent& e)
{ ChangeToEqualIntervals(8); }
void GdaFrame::OnEqualIntervals9(wxCommandEvent& e)
{ ChangeToEqualIntervals(9); }
void GdaFrame::OnEqualIntervals10(wxCommandEvent& e)
{ ChangeToEqualIntervals(10); }
void GdaFrame::ChangeToEqualIntervals(int num_cats)
{
wxLogMessage(wxString::Format("In GdaFrame::ChangeToEqualIntervals(%d)", num_cats));
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
wxCommandEvent event;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) return;
if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnEqualIntervals(num_cats);
} else if (ScatterNewPlotFrame* f = dynamic_cast<ScatterNewPlotFrame*>(t)) {
f->OnEqualIntervals(num_cats);
} else if (PCPFrame* f = dynamic_cast<PCPFrame*>(t)) {
f->OnEqualIntervals(num_cats);
} else if (CartogramNewFrame* f = dynamic_cast<CartogramNewFrame*>(t)) {
f->OnEqualIntervals(num_cats);
} else if (ConditionalMapFrame* f = dynamic_cast<ConditionalMapFrame*>(t)) {
f->OnEqualIntervals(num_cats);
}
}
void GdaFrame::OnOpenUniqueValues(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnOpenUniqueValues()");
bool show_str_var = true;
VariableSettingsDlg dlg(project_p, VariableSettingsDlg::univariate,
// default values
false, false, _("Variable Settings"), "", "","","",false, false, false,
show_str_var);
if (dlg.ShowModal() != wxID_OK) return;
MapFrame* nf = new MapFrame(GdaFrame::gda_frame, project_p,
dlg.var_info, dlg.col_ids,
CatClassification::unique_values,
MapCanvas::no_smoothing, 4,
boost::uuids::nil_uuid(),
wxDefaultPosition,
GdaConst::map_default_size);
nf->UpdateTitle();
}
void GdaFrame::OnOpenColocationMap(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnOpenColocationMap()");
FramesManager* fm = project_p->GetFramesManager();
std::list<FramesManagerObserver*> observers(fm->getCopyObservers());
std::list<FramesManagerObserver*>::iterator it;
for (it=observers.begin(); it != observers.end(); ++it) {
if (ColocationSelectDlg* w = dynamic_cast<ColocationSelectDlg*>(*it)) {
w->Show(true);
w->Maximize(false);
w->Raise();
return;
}
}
ColocationSelectDlg* dlg = new ColocationSelectDlg(this, project_p);
dlg->Show(true);
}
void GdaFrame::OnUniqueValues(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnUniqueValues()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) return;
if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnUniqueValues();
} else if (ScatterNewPlotFrame* f = dynamic_cast<ScatterNewPlotFrame*>(t)) {
f->OnUniqueValues();
} else if (PCPFrame* f = dynamic_cast<PCPFrame*>(t)) {
f->OnUniqueValues();
} else if (CartogramNewFrame* f = dynamic_cast<CartogramNewFrame*>(t)) {
f->OnUniqueValues();
} else if (ConditionalMapFrame* f = dynamic_cast<ConditionalMapFrame*>(t)) {
f->OnUniqueValues();
}
}
void GdaFrame::OnCondVertThemelessMap(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnCondVertThemelessMap()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ConditionalNewFrame* f = dynamic_cast<ConditionalNewFrame*>(t)) {
f->ChangeVertThemeType(CatClassification::no_theme, 1);
}
}
void GdaFrame::OnCondVertQuant1(wxCommandEvent& e)
{ ChangeToCondVertQuant(1); }
void GdaFrame::OnCondVertQuant2(wxCommandEvent& e)
{ ChangeToCondVertQuant(2); }
void GdaFrame::OnCondVertQuant3(wxCommandEvent& e)
{ ChangeToCondVertQuant(3); }
void GdaFrame::OnCondVertQuant4(wxCommandEvent& e)
{ ChangeToCondVertQuant(4); }
void GdaFrame::OnCondVertQuant5(wxCommandEvent& e)
{ ChangeToCondVertQuant(5); }
void GdaFrame::OnCondVertQuant6(wxCommandEvent& e)
{ ChangeToCondVertQuant(6); }
void GdaFrame::OnCondVertQuant7(wxCommandEvent& e)
{ ChangeToCondVertQuant(7); }
void GdaFrame::OnCondVertQuant8(wxCommandEvent& e)
{ ChangeToCondVertQuant(8); }
void GdaFrame::OnCondVertQuant9(wxCommandEvent& e)
{ ChangeToCondVertQuant(9); }
void GdaFrame::OnCondVertQuant10(wxCommandEvent& e)
{ ChangeToCondVertQuant(10); }
void GdaFrame::ChangeToCondVertQuant(int num_cats)
{
wxLogMessage(wxString::Format("In GdaFrame::ChangeToCondVertQuant(%d)", num_cats));
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ConditionalNewFrame* f = dynamic_cast<ConditionalNewFrame*>(t)) {
f->ChangeVertThemeType(CatClassification::quantile, num_cats);
}
}
void GdaFrame::OnCondVertPercentile(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnCondVertPercentile()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ConditionalNewFrame* f = dynamic_cast<ConditionalNewFrame*>(t)) {
f->ChangeVertThemeType(CatClassification::percentile, 6);
}
}
void GdaFrame::OnCondVertHinge15(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnCondVertHinge15()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ConditionalNewFrame* f = dynamic_cast<ConditionalNewFrame*>(t)) {
f->ChangeVertThemeType(CatClassification::hinge_15, 6);
}
}
void GdaFrame::OnCondVertHinge30(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnCondVertHinge30()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ConditionalNewFrame* f = dynamic_cast<ConditionalNewFrame*>(t)) {
f->ChangeVertThemeType(CatClassification::hinge_30, 6);
}
}
void GdaFrame::OnCondVertStddev(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnCondVertStddev()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ConditionalNewFrame* f = dynamic_cast<ConditionalNewFrame*>(t)) {
f->ChangeVertThemeType(CatClassification::stddev, 6);
}
}
void GdaFrame::OnCondVertNatBrks1(wxCommandEvent& e)
{ ChangeToCondVertNatBrks(1); }
void GdaFrame::OnCondVertNatBrks2(wxCommandEvent& e)
{ ChangeToCondVertNatBrks(2); }
void GdaFrame::OnCondVertNatBrks3(wxCommandEvent& e)
{ ChangeToCondVertNatBrks(3); }
void GdaFrame::OnCondVertNatBrks4(wxCommandEvent& e)
{ ChangeToCondVertNatBrks(4); }
void GdaFrame::OnCondVertNatBrks5(wxCommandEvent& e)
{ ChangeToCondVertNatBrks(5); }
void GdaFrame::OnCondVertNatBrks6(wxCommandEvent& e)
{ ChangeToCondVertNatBrks(6); }
void GdaFrame::OnCondVertNatBrks7(wxCommandEvent& e)
{ ChangeToCondVertNatBrks(7); }
void GdaFrame::OnCondVertNatBrks8(wxCommandEvent& e)
{ ChangeToCondVertNatBrks(8); }
void GdaFrame::OnCondVertNatBrks9(wxCommandEvent& e)
{ ChangeToCondVertNatBrks(9); }
void GdaFrame::OnCondVertNatBrks10(wxCommandEvent& e)
{ChangeToCondVertNatBrks(10);}
void GdaFrame::ChangeToCondVertNatBrks(int num_cats)
{
wxLogMessage(wxString::Format("In GdaFrame::ChangeToCondVertNatBrks(%d)", num_cats));
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ConditionalNewFrame* f = dynamic_cast<ConditionalNewFrame*>(t)) {
f->ChangeVertThemeType(CatClassification::natural_breaks, num_cats);
}
}
void GdaFrame::OnCondVertEquInts1(wxCommandEvent& e)
{ ChangeToCondVertEquInts(1); }
void GdaFrame::OnCondVertEquInts2(wxCommandEvent& e)
{ ChangeToCondVertEquInts(2); }
void GdaFrame::OnCondVertEquInts3(wxCommandEvent& e)
{ ChangeToCondVertEquInts(3); }
void GdaFrame::OnCondVertEquInts4(wxCommandEvent& e)
{ ChangeToCondVertEquInts(4); }
void GdaFrame::OnCondVertEquInts5(wxCommandEvent& e)
{ ChangeToCondVertEquInts(5); }
void GdaFrame::OnCondVertEquInts6(wxCommandEvent& e)
{ ChangeToCondVertEquInts(6); }
void GdaFrame::OnCondVertEquInts7(wxCommandEvent& e)
{ ChangeToCondVertEquInts(7); }
void GdaFrame::OnCondVertEquInts8(wxCommandEvent& e)
{ ChangeToCondVertEquInts(8); }
void GdaFrame::OnCondVertEquInts9(wxCommandEvent& e)
{ ChangeToCondVertEquInts(9); }
void GdaFrame::OnCondVertEquInts10(wxCommandEvent& e)
{ ChangeToCondVertEquInts(10); }
void GdaFrame::ChangeToCondVertEquInts(int num_cats)
{
wxLogMessage(wxString::Format("In GdaFrame::ChangeToCondVertEquInts(%d)", num_cats));
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ConditionalNewFrame* f = dynamic_cast<ConditionalNewFrame*>(t)) {
f->ChangeVertThemeType(CatClassification::equal_intervals, num_cats);
}
}
void GdaFrame::OnCondVertUniqueValues(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnCondVertUniqueValues()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ConditionalNewFrame* f = dynamic_cast<ConditionalNewFrame*>(t)) {
f->ChangeVertThemeType(CatClassification::unique_values, 4);
}
}
void GdaFrame::OnCondHorizThemelessMap(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnCondHorizThemelessMap()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ConditionalNewFrame* f = dynamic_cast<ConditionalNewFrame*>(t)) {
f->ChangeHorizThemeType(CatClassification::no_theme, 1);
}
}
void GdaFrame::OnCondHorizQuant1(wxCommandEvent& e)
{ ChangeToCondHorizQuant(1); }
void GdaFrame::OnCondHorizQuant2(wxCommandEvent& e)
{ ChangeToCondHorizQuant(2); }
void GdaFrame::OnCondHorizQuant3(wxCommandEvent& e)
{ ChangeToCondHorizQuant(3); }
void GdaFrame::OnCondHorizQuant4(wxCommandEvent& e)
{ ChangeToCondHorizQuant(4); }
void GdaFrame::OnCondHorizQuant5(wxCommandEvent& e)
{ ChangeToCondHorizQuant(5); }
void GdaFrame::OnCondHorizQuant6(wxCommandEvent& e)
{ ChangeToCondHorizQuant(6); }
void GdaFrame::OnCondHorizQuant7(wxCommandEvent& e)
{ ChangeToCondHorizQuant(7); }
void GdaFrame::OnCondHorizQuant8(wxCommandEvent& e)
{ ChangeToCondHorizQuant(8); }
void GdaFrame::OnCondHorizQuant9(wxCommandEvent& e)
{ ChangeToCondHorizQuant(9); }
void GdaFrame::OnCondHorizQuant10(wxCommandEvent& e)
{ ChangeToCondHorizQuant(10); }
void GdaFrame::ChangeToCondHorizQuant(int num_cats)
{
wxLogMessage(wxString::Format("In GdaFrame::ChangeToCondHorizQuant(%d)", num_cats));
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ConditionalNewFrame* f = dynamic_cast<ConditionalNewFrame*>(t)) {
f->ChangeHorizThemeType(CatClassification::quantile, num_cats);
}
}
void GdaFrame::OnCondHorizPercentile(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnCondHorizPercentile()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ConditionalNewFrame* f = dynamic_cast<ConditionalNewFrame*>(t)) {
f->ChangeHorizThemeType(CatClassification::percentile, 6);
}
}
void GdaFrame::OnCondHorizHinge15(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnCondHorizHinge15()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ConditionalNewFrame* f = dynamic_cast<ConditionalNewFrame*>(t)) {
f->ChangeHorizThemeType(CatClassification::hinge_15, 6);
}
}
void GdaFrame::OnCondHorizHinge30(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnCondHorizHinge30()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ConditionalNewFrame* f = dynamic_cast<ConditionalNewFrame*>(t)) {
f->ChangeHorizThemeType(CatClassification::hinge_30, 6);
}
}
void GdaFrame::OnCondHorizStddev(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnCondHorizStddev()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ConditionalNewFrame* f = dynamic_cast<ConditionalNewFrame*>(t)) {
f->ChangeHorizThemeType(CatClassification::stddev, 6);
}
}
void GdaFrame::OnCondHorizNatBrks1(wxCommandEvent& e)
{ ChangeToCondHorizNatBrks(1); }
void GdaFrame::OnCondHorizNatBrks2(wxCommandEvent& e)
{ ChangeToCondHorizNatBrks(2); }
void GdaFrame::OnCondHorizNatBrks3(wxCommandEvent& e)
{ ChangeToCondHorizNatBrks(3); }
void GdaFrame::OnCondHorizNatBrks4(wxCommandEvent& e)
{ ChangeToCondHorizNatBrks(4); }
void GdaFrame::OnCondHorizNatBrks5(wxCommandEvent& e)
{ ChangeToCondHorizNatBrks(5); }
void GdaFrame::OnCondHorizNatBrks6(wxCommandEvent& e)
{ ChangeToCondHorizNatBrks(6); }
void GdaFrame::OnCondHorizNatBrks7(wxCommandEvent& e)
{ ChangeToCondHorizNatBrks(7); }
void GdaFrame::OnCondHorizNatBrks8(wxCommandEvent& e)
{ ChangeToCondHorizNatBrks(8); }
void GdaFrame::OnCondHorizNatBrks9(wxCommandEvent& e)
{ ChangeToCondHorizNatBrks(9); }
void GdaFrame::OnCondHorizNatBrks10(wxCommandEvent& e)
{ChangeToCondHorizNatBrks(10);}
void GdaFrame::ChangeToCondHorizNatBrks(int num_cats)
{
wxLogMessage(wxString::Format("In GdaFrame::ChangeToCondHorizNatBrks(%d)", num_cats));
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ConditionalNewFrame* f = dynamic_cast<ConditionalNewFrame*>(t)) {
f->ChangeHorizThemeType(CatClassification::natural_breaks, num_cats);
}
}
void GdaFrame::OnCondHorizEquInts1(wxCommandEvent& e)
{ ChangeToCondHorizEquInts(1); }
void GdaFrame::OnCondHorizEquInts2(wxCommandEvent& e)
{ ChangeToCondHorizEquInts(2); }
void GdaFrame::OnCondHorizEquInts3(wxCommandEvent& e)
{ ChangeToCondHorizEquInts(3); }
void GdaFrame::OnCondHorizEquInts4(wxCommandEvent& e)
{ ChangeToCondHorizEquInts(4); }
void GdaFrame::OnCondHorizEquInts5(wxCommandEvent& e)
{ ChangeToCondHorizEquInts(5); }
void GdaFrame::OnCondHorizEquInts6(wxCommandEvent& e)
{ ChangeToCondHorizEquInts(6); }
void GdaFrame::OnCondHorizEquInts7(wxCommandEvent& e)
{ ChangeToCondHorizEquInts(7); }
void GdaFrame::OnCondHorizEquInts8(wxCommandEvent& e)
{ ChangeToCondHorizEquInts(8); }
void GdaFrame::OnCondHorizEquInts9(wxCommandEvent& e)
{ ChangeToCondHorizEquInts(9); }
void GdaFrame::OnCondHorizEquInts10(wxCommandEvent& e)
{ ChangeToCondHorizEquInts(10); }
void GdaFrame::ChangeToCondHorizEquInts(int num_cats)
{
wxLogMessage(wxString::Format("In GdaFrame::ChangeToCondHorizEquInts(%d)", num_cats));
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ConditionalNewFrame* f = dynamic_cast<ConditionalNewFrame*>(t)) {
f->ChangeHorizThemeType(CatClassification::equal_intervals, num_cats);
}
}
void GdaFrame::OnCondHorizUniqueValues(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnCondHorizUniqueValues()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ConditionalNewFrame* f = dynamic_cast<ConditionalNewFrame*>(t)) {
f->ChangeHorizThemeType(CatClassification::unique_values, 4);
}
}
void GdaFrame::OnSaveCategories(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnSaveCategories()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnSaveCategories();
} else if (ScatterNewPlotFrame* f = dynamic_cast<ScatterNewPlotFrame*>(t)) {
f->OnSaveCategories();
} else if (PCPFrame* f = dynamic_cast<PCPFrame*>(t)) {
f->OnSaveCategories();
} else if (CartogramNewFrame* f = dynamic_cast<CartogramNewFrame*>(t)) {
f->OnSaveCategories();
} else if (ConditionalMapFrame* f = dynamic_cast<ConditionalMapFrame*>(t)) {
f->OnSaveCategories();
}
}
void GdaFrame::OnOpenRawrate(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnOpenRawrate()");
VariableSettingsDlg dlg(project_p, VariableSettingsDlg::rate_smoothed,
false, false,
"Raw Rate Smoothed Variable Settings",
"Event Variable", "Base Variable");
if (dlg.ShowModal() != wxID_OK) return;
MapFrame* nf = new MapFrame(GdaFrame::gda_frame, project_p,
dlg.var_info, dlg.col_ids,
dlg.GetCatClassifType(),
MapCanvas::raw_rate,
dlg.GetNumCategories(),
boost::uuids::nil_uuid(),
wxDefaultPosition,
GdaConst::map_default_size);
nf->UpdateTitle();
}
void GdaFrame::OnRawrate(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnRawrate()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) return;
if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnRawrate();
}
}
void GdaFrame::OnOpenExcessrisk(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnOpenExcessrisk()");
VariableSettingsDlg dlg(project_p, VariableSettingsDlg::bivariate, false,
false,
_("Excess Risk Map Variable Settings"),
_("Event Variable"), _("Base Variable"));
if (dlg.ShowModal() != wxID_OK) return;
MapFrame* nf = new MapFrame(GdaFrame::gda_frame, project_p,
dlg.var_info, dlg.col_ids,
CatClassification::excess_risk_theme,
MapCanvas::excess_risk, 6,
boost::uuids::nil_uuid(),
wxDefaultPosition,
GdaConst::map_default_size);
nf->UpdateTitle();
}
void GdaFrame::OnExcessrisk(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnExcessrisk()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) return;
if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnExcessRisk();
}
}
void GdaFrame::OnOpenEmpiricalBayes(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnOpenEmpiricalBayes()");
VariableSettingsDlg dlg(project_p, VariableSettingsDlg::rate_smoothed,
false, false,
_("Empirical Bayes Smoothed Variable Settings"),
_("Event Variable"), _("Base Variable"));
if (dlg.ShowModal() != wxID_OK) return;
MapFrame* nf = new MapFrame(GdaFrame::gda_frame, project_p,
dlg.var_info, dlg.col_ids,
dlg.GetCatClassifType(),
MapCanvas::empirical_bayes,
dlg.GetNumCategories(),
boost::uuids::nil_uuid(),
wxDefaultPosition,
GdaConst::map_default_size);
nf->UpdateTitle();
}
void GdaFrame::OnEmpiricalBayes(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnEmpiricalBayes()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) return;
if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnEmpiricalBayes();
}
}
void GdaFrame::OnOpenSpatialRate(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnOpenSpatialRate()");
VariableSettingsDlg dlg(project_p, VariableSettingsDlg::rate_smoothed,
true, false,
_("Spatial Rate Smoothed Variable Settings"),
_("Event Variable"), _("Base Variable"));
if (dlg.ShowModal() != wxID_OK) return;
MapFrame* nf = new MapFrame(GdaFrame::gda_frame, project_p,
dlg.var_info, dlg.col_ids,
dlg.GetCatClassifType(),
MapCanvas::spatial_rate,
dlg.GetNumCategories(),
dlg.GetWeightsId(),
wxDefaultPosition,
GdaConst::map_default_size);
nf->UpdateTitle();
}
void GdaFrame::OnSpatialRate(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnSpatialRate()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) return;
if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnSpatialRate();
}
}
void GdaFrame::OnOpenSpatialEmpiricalBayes(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnOpenSpatialEmpiricalBayes()");
VariableSettingsDlg dlg(project_p, VariableSettingsDlg::rate_smoothed,
true, false,
_("Empirical Spatial Rate Smoothed Variable Settings"),
_("Event Variable"), _("Base Variable"));
if (dlg.ShowModal() != wxID_OK) return;
MapFrame* nf = new MapFrame(GdaFrame::gda_frame, project_p,
dlg.var_info, dlg.col_ids,
dlg.GetCatClassifType(),
MapCanvas::spatial_empirical_bayes,
dlg.GetNumCategories(),
dlg.GetWeightsId(),
wxDefaultPosition,
GdaConst::map_default_size);
nf->UpdateTitle();
}
void GdaFrame::OnSpatialEmpiricalBayes(wxCommandEvent& event)
{
wxLogMessage("In OnSpatialEmpiricalBayes()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) return;
if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnSpatialEmpiricalBayes();
}
}
void GdaFrame::OnSaveResults(wxCommandEvent& event)
{
wxLogMessage("In OnSaveResults()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) return;
if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnSaveRates();
}
}
void GdaFrame::OnSelectIsolates(wxCommandEvent& event)
{
wxLogMessage("In OnSelectIsolates()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ConnectivityHistFrame* f = dynamic_cast<ConnectivityHistFrame*>(t)) {
f->OnSelectIsolates(event);
} else if (WeightsManFrame* f = dynamic_cast<WeightsManFrame*>(t)) {
f->OnSelectIsolates(event);
}
}
void GdaFrame::OnSaveConnectivityToTable(wxCommandEvent& event)
{
wxLogMessage("In OnSaveConnectivityToTable()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ConnectivityHistFrame* f = dynamic_cast<ConnectivityHistFrame*>(t)) {
f->OnSaveConnectivityToTable(event);
} else if (WeightsManFrame* f = dynamic_cast<WeightsManFrame*>(t)) {
f->OnSaveConnectivityToTable(event);
}
}
void GdaFrame::OnHistogramIntervals(wxCommandEvent& event)
{
wxLogMessage("In OnHistogramIntervals()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ConnectivityHistFrame* f = dynamic_cast<ConnectivityHistFrame*>(t)) {
f->OnHistogramIntervals(event);
} else if (WeightsManFrame* f = dynamic_cast<WeightsManFrame*>(t)) {
f->OnHistogramIntervals(event);
} else if (ConditionalHistogramFrame* f =
dynamic_cast<ConditionalHistogramFrame*>(t)) {
f->OnHistogramIntervals(event);
} else if (HistogramFrame* f = dynamic_cast<HistogramFrame*>(t)) {
f->OnHistogramIntervals(event);
}
}
void GdaFrame::OnRan99Per(wxCommandEvent& event)
{
wxLogMessage("In OnRan99Per()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) {
f->OnRan99Per(event);
} else if (LisaScatterPlotFrame* f = dynamic_cast<LisaScatterPlotFrame*>(t)) {
f->OnRan99Per(event);
} else if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) {
f->OnRan99Per(event);
} else if (LocalGearyMapFrame* f = dynamic_cast<LocalGearyMapFrame*>(t)) {
f->OnRan99Per(event);
} else if (MLJCMapFrame* f = dynamic_cast<MLJCMapFrame*>(t)) {
f->OnRan99Per(event);
}
}
void GdaFrame::OnRan199Per(wxCommandEvent& event)
{
wxLogMessage("In OnRan199Per()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) {
f->OnRan199Per(event);
} else if (LisaScatterPlotFrame* f
= dynamic_cast<LisaScatterPlotFrame*>(t)) {
f->OnRan199Per(event);
} else if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) {
f->OnRan199Per(event);
} else if (LocalGearyMapFrame* f = dynamic_cast<LocalGearyMapFrame*>(t)) {
f->OnRan199Per(event);
} else if (MLJCMapFrame* f = dynamic_cast<MLJCMapFrame*>(t)) {
f->OnRan199Per(event);
}
}
void GdaFrame::OnRan499Per(wxCommandEvent& event)
{
wxLogMessage("In OnRan499Per()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) {
f->OnRan499Per(event);
} else if (LisaScatterPlotFrame* f
= dynamic_cast<LisaScatterPlotFrame*>(t)) {
f->OnRan499Per(event);
} else if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) {
f->OnRan499Per(event);
} else if (LocalGearyMapFrame* f = dynamic_cast<LocalGearyMapFrame*>(t)) {
f->OnRan499Per(event);
} else if (MLJCMapFrame* f = dynamic_cast<MLJCMapFrame*>(t)) {
f->OnRan499Per(event);
}
}
void GdaFrame::OnRan999Per(wxCommandEvent& event)
{
wxLogMessage("In OnRan999Per()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) {
f->OnRan999Per(event);
} else if (LisaScatterPlotFrame* f
= dynamic_cast<LisaScatterPlotFrame*>(t)) {
f->OnRan999Per(event);
} else if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) {
f->OnRan999Per(event);
} else if (LocalGearyMapFrame* f = dynamic_cast<LocalGearyMapFrame*>(t)) {
f->OnRan999Per(event);
} else if (MLJCMapFrame* f = dynamic_cast<MLJCMapFrame*>(t)) {
f->OnRan999Per(event);
}
}
void GdaFrame::OnRanOtherPer(wxCommandEvent& event)
{
wxLogMessage("In OnRanOtherPer()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) {
f->OnRanOtherPer(event);
} else if (LisaScatterPlotFrame* f
= dynamic_cast<LisaScatterPlotFrame*>(t)) {
f->OnRanOtherPer(event);
} else if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) {
f->OnRanOtherPer(event);
} else if (LocalGearyMapFrame* f = dynamic_cast<LocalGearyMapFrame*>(t)) {
f->OnRanOtherPer(event);
} else if (MLJCMapFrame* f = dynamic_cast<MLJCMapFrame*>(t)) {
f->OnRanOtherPer(event);
}
}
void GdaFrame::OnUseSpecifiedSeed(wxCommandEvent& event)
{
wxLogMessage("In OnUseSpecifiedSeed()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) {
f->OnUseSpecifiedSeed(event);
} else if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) {
f->OnUseSpecifiedSeed(event);
} else if (LisaScatterPlotFrame* f = dynamic_cast<LisaScatterPlotFrame*>(t)) {
f->OnUseSpecifiedSeed(event);
} else if (LocalGearyMapFrame* f = dynamic_cast<LocalGearyMapFrame*>(t)) {
f->OnUseSpecifiedSeed(event);
} else if (MLJCMapFrame* f = dynamic_cast<MLJCMapFrame*>(t)) {
f->OnUseSpecifiedSeed(event);
}
}
void GdaFrame::OnSpecifySeedDlg(wxCommandEvent& event)
{
wxLogMessage("In OnSpecifySeedDlg()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) {
f->OnSpecifySeedDlg(event);
} else if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) {
f->OnSpecifySeedDlg(event);
} else if (LisaScatterPlotFrame* f = dynamic_cast<LisaScatterPlotFrame*>(t)) {
f->OnSpecifySeedDlg(event);
} else if (LocalGearyMapFrame* f = dynamic_cast<LocalGearyMapFrame*>(t)) {
f->OnSpecifySeedDlg(event);
} else if (MLJCMapFrame* f = dynamic_cast<MLJCMapFrame*>(t)) {
f->OnSpecifySeedDlg(event);
}
}
void GdaFrame::OnDisplayPrecision(wxCommandEvent& event)
{
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (PCPFrame* f = dynamic_cast<PCPFrame*>(t)) {
f->OnDisplayPrecision(event);
} else if (LisaScatterPlotFrame* f = dynamic_cast<LisaScatterPlotFrame*>(t)) {
f->OnDisplayPrecision(event);
} else if (ScatterNewPlotFrame* f = dynamic_cast<ScatterNewPlotFrame*>(t)) {
f->OnDisplayPrecision(event);
} else if (BoxPlotFrame* f = dynamic_cast<BoxPlotFrame*>(t)) {
f->OnDisplayPrecision(event);
} else if (HistogramFrame* f = dynamic_cast<HistogramFrame*>(t)) {
f->OnDisplayPrecision(event);
} else if (ConditionalNewFrame* f = dynamic_cast<ConditionalNewFrame*>(t)) {
f->OnDisplayPrecision(event);
} else if (CorrelogramFrame* f = dynamic_cast<CorrelogramFrame*>(t)) {
f->OnDisplayPrecision(event);
} else if (DistancePlotFrame* f = dynamic_cast<DistancePlotFrame*>(t)) {
f->OnDisplayPrecision(event);
}
}
void GdaFrame::OnSaveMoranI(wxCommandEvent& event)
{
wxLogMessage("In OnSaveMoranI()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaScatterPlotFrame* f = dynamic_cast<LisaScatterPlotFrame*>(t)) {
f->OnSaveMoranI(event);
}
}
void GdaFrame::OnSigFilter05(wxCommandEvent& event)
{
wxLogMessage("In OnSigFilter05()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) {
f->OnSigFilter05(event);
} else if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) {
f->OnSigFilter05(event);
} else if (LocalGearyMapFrame* f = dynamic_cast<LocalGearyMapFrame*>(t)) {
f->OnSigFilter05(event);
} else if (MLJCMapFrame* f = dynamic_cast<MLJCMapFrame*>(t)) {
f->OnSigFilter05(event);
}
}
void GdaFrame::OnSigFilter01(wxCommandEvent& event)
{
wxLogMessage("In OnSigFilter01()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) {
f->OnSigFilter01(event);
} else if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) {
f->OnSigFilter01(event);
} else if (LocalGearyMapFrame* f = dynamic_cast<LocalGearyMapFrame*>(t)) {
f->OnSigFilter01(event);
} else if (MLJCMapFrame* f = dynamic_cast<MLJCMapFrame*>(t)) {
f->OnSigFilter01(event);
}
}
void GdaFrame::OnSigFilter001(wxCommandEvent& event)
{
wxLogMessage("In OnSigFilter001()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) {
f->OnSigFilter001(event);
} else if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) {
f->OnSigFilter001(event);
} else if (LocalGearyMapFrame* f = dynamic_cast<LocalGearyMapFrame*>(t)) {
f->OnSigFilter001(event);
} else if (MLJCMapFrame* f = dynamic_cast<MLJCMapFrame*>(t)) {
f->OnSigFilter001(event);
}
}
void GdaFrame::OnSigFilter0001(wxCommandEvent& event)
{
wxLogMessage("In OnSigFilter0001()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) {
f->OnSigFilter0001(event);
} else if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) {
f->OnSigFilter0001(event);
} else if (LocalGearyMapFrame* f = dynamic_cast<LocalGearyMapFrame*>(t)) {
f->OnSigFilter0001(event);
} else if (MLJCMapFrame* f = dynamic_cast<MLJCMapFrame*>(t)) {
f->OnSigFilter0001(event);
}
}
void GdaFrame::OnSigFilterSetup(wxCommandEvent& event)
{
wxLogMessage("In OnSigFilterSetup()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) {
f->OnSigFilterSetup(event);
} else if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) {
f->OnSigFilterSetup(event);
} else if (LocalGearyMapFrame* f = dynamic_cast<LocalGearyMapFrame*>(t)) {
f->OnSigFilterSetup(event);
} else if (MLJCMapFrame* f = dynamic_cast<MLJCMapFrame*>(t)) {
f->OnSigFilterSetup(event);
}
}
void GdaFrame::OnAddMeanCenters(wxCommandEvent& event)
{
wxLogMessage("In OnAddMeanCenters()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->GetProject()->AddMeanCenters();
}
}
void GdaFrame::OnAddCentroids(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnAddCentroids()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->GetProject()->AddCentroids();
}
}
void GdaFrame::OnDisplayMeanCenters(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnDisplayMeanCenters()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnDisplayMeanCenters();
}
}
void GdaFrame::OnDisplayWeightsGraph(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnDisplayWeightsGraph()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnDisplayWeightsGraph(event);
}
}
void GdaFrame::OnDisplayMapWithGraph(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnDisplayMapWithGraph()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnDisplayMapWithGraph(event);
}
}
void GdaFrame::OnChangeGraphThickness(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnChangeGraphThickness()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnChangeGraphThickness(event);
}
}
void GdaFrame::OnChangeGraphColor(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnChangeGraphColor()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnChangeGraphColor(event);
}
}
void GdaFrame::OnChangeConnSelectedColor(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnChangeConnSelectedColor()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnChangeConnSelectedColor(event);
}
}
void GdaFrame::OnChangeConnSelectedFillColor(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnChangeConnSelectedFillColor()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnChangeConnSelectedFillColor(event);
}
}
void GdaFrame::OnChangeConnRootSize(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnChangeConnRootSize()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (HierachicalMapFrame* f = dynamic_cast<HierachicalMapFrame*>(t)) {
f->OnChangeConnRootSize(event);
}
}
void GdaFrame::OnChangeConnRootColor(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnChangeConnRootColor()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (HierachicalMapFrame* f = dynamic_cast<HierachicalMapFrame*>(t)) {
f->OnChangeConnRootColor(event);
}
}
void GdaFrame::OnChangeNeighborFillColor(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnChangeNeighborFillColor()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnChangeNeighborFillColor(event);
}
}
void GdaFrame::OnDisplayCentroids(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnDisplayCentroids()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnDisplayCentroids();
}
}
void GdaFrame::OnDisplayVoronoiDiagram(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnDisplayVoronoiDiagram()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnDisplayVoronoiDiagram();
}
}
void GdaFrame::OnExportVoronoi(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnExportVoronoi()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnExportVoronoi();
}
}
void GdaFrame::OnExportMeanCntrs(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnExportMeanCntrs()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnExportMeanCntrs();
}
}
void GdaFrame::OnExportCentroids(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnExportCentroids()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnExportCentroids();
}
}
void GdaFrame::OnSaveVoronoiDupsToTable(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnSaveVoronoiDupsToTable()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnSaveVoronoiDupsToTable();
} else {
if (project_p) project_p->SaveVoronoiDupsToTable();
}
}
void GdaFrame::OnSaveGetisOrd(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnSaveGetisOrd()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) {
f->OnSaveGetisOrd(event);
} else if (MLJCMapFrame* f = dynamic_cast<MLJCMapFrame*>(t)) {
f->OnSaveMLJC(event);
}
}
void GdaFrame::OnSaveLisa(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnSaveLisa()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) {
f->OnSaveResult(event);
} else if (LocalGearyMapFrame* f = dynamic_cast<LocalGearyMapFrame*>(t)) {
f->OnSaveLocalGeary(event);
}
}
void GdaFrame::OnSaveColocation(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnSaveColocation()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ColocationMapFrame* f = dynamic_cast<ColocationMapFrame*>(t)) {
f->OnSave(event);
}
}
void GdaFrame::OnSelectCores(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnSelectCores()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) {
f->OnSelectCores(event);
} else if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) {
f->OnSelectCores(event);
} else if (LocalGearyMapFrame* f = dynamic_cast<LocalGearyMapFrame*>(t)) {
f->OnSelectCores(event);
} else if (MLJCMapFrame* f = dynamic_cast<MLJCMapFrame*>(t)) {
f->OnSelectCores(event);
}
}
void GdaFrame::OnSelectNeighborsOfCores(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnSelectNeighborsOfCores()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) {
f->OnSelectNeighborsOfCores(event);
} else if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) {
f->OnSelectNeighborsOfCores(event);
} else if (LocalGearyMapFrame* f = dynamic_cast<LocalGearyMapFrame*>(t)) {
f->OnSelectNeighborsOfCores(event);
} else if (MLJCMapFrame* f = dynamic_cast<MLJCMapFrame*>(t)) {
f->OnSelectNeighborsOfCores(event);
}
}
void GdaFrame::OnSelectCoresAndNeighbors(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnSelectCoresAndNeighbors()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) {
f->OnSelectCoresAndNeighbors(event);
} else if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) {
f->OnSelectCoresAndNeighbors(event);
} else if (LocalGearyMapFrame* f = dynamic_cast<LocalGearyMapFrame*>(t)) {
f->OnSelectCoresAndNeighbors(event);
} else if (MLJCMapFrame* f = dynamic_cast<MLJCMapFrame*>(t)) {
f->OnSelectCoresAndNeighbors(event);
}
}
void GdaFrame::OnAddNeighborToSelection(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnAddNeighborToSelection()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (MapFrame* f = dynamic_cast<MapFrame*>(t)) {
f->OnAddNeighborToSelection(event);
} else if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) {
f->OnAddNeighborToSelection(event);
} else if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) {
f->OnAddNeighborToSelection(event);
} else if (LocalGearyMapFrame* f = dynamic_cast<LocalGearyMapFrame*>(t)) {
f->OnAddNeighborToSelection(event);
} else if (MLJCMapFrame* f = dynamic_cast<MLJCMapFrame*>(t)) {
f->OnAddNeighborToSelection(event);
}
}
void GdaFrame::OnShowAsConditionalMap(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnShowAsConditionalMap()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaMapFrame* f = dynamic_cast<LisaMapFrame*>(t)) {
f->OnShowAsConditionalMap(event);
} else if (GetisOrdMapFrame* f = dynamic_cast<GetisOrdMapFrame*>(t)) {
f->OnShowAsConditionalMap(event);
} else if (LocalGearyMapFrame* f = dynamic_cast<LocalGearyMapFrame*>(t)) {
f->OnShowAsConditionalMap(event);
} else if (MLJCMapFrame* f = dynamic_cast<MLJCMapFrame*>(t)) {
f->OnShowAsConditionalMap(event);
}
}
void GdaFrame::OnViewStandardizedData(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnViewStandardizedData()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (PCPFrame* f = dynamic_cast<PCPFrame*>(t)) {
f->OnViewStandardizedData(event);
} else if (ScatterNewPlotFrame* f = dynamic_cast<ScatterNewPlotFrame*>(t)) {
f->OnViewStandardizedData(event);
} else if (ScatterPlotMatFrame* f = dynamic_cast<ScatterPlotMatFrame*>(t)) {
f->OnViewStandardizedData(event);
}
}
void GdaFrame::OnViewOriginalData(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnViewOriginalData()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (PCPFrame* f = dynamic_cast<PCPFrame*>(t)) {
f->OnViewOriginalData(event);
} else if (ScatterNewPlotFrame* f = dynamic_cast<ScatterNewPlotFrame*>(t)) {
f->OnViewOriginalData(event);
} else if (ScatterPlotMatFrame* f = dynamic_cast<ScatterPlotMatFrame*>(t)) {
f->OnViewOriginalData(event);
}
}
void GdaFrame::OnViewLinearSmoother(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnViewLinearSmoother()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ScatterNewPlotFrame* f = dynamic_cast<ScatterNewPlotFrame*>(t)) {
f->OnViewLinearSmoother(event);
} else if (ScatterPlotMatFrame* f = dynamic_cast<ScatterPlotMatFrame*>(t)) {
f->OnViewLinearSmoother(event);
} else if (ConditionalScatterPlotFrame* f =
dynamic_cast<ConditionalScatterPlotFrame*>(t)) {
f->OnViewLinearSmoother(event);
}
}
void GdaFrame::OnViewLowessSmoother(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnViewLowessSmoother()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ScatterNewPlotFrame* f = dynamic_cast<ScatterNewPlotFrame*>(t)) {
f->OnViewLowessSmoother(event);
} else if (ScatterPlotMatFrame* f = dynamic_cast<ScatterPlotMatFrame*>(t)) {
f->OnViewLowessSmoother(event);
} else if (CovSpFrame* f = dynamic_cast<CovSpFrame*>(t)) {
f->OnViewLowessSmoother(event);
} else if (ConditionalScatterPlotFrame* f =
dynamic_cast<ConditionalScatterPlotFrame*>(t)) {
f->OnViewLowessSmoother(event);
}
}
void GdaFrame::OnEditLowessParams(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnEditLowessParams()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ScatterNewPlotFrame* f = dynamic_cast<ScatterNewPlotFrame*>(t)) {
f->OnEditLowessParams(event);
} else if (ScatterPlotMatFrame* f = dynamic_cast<ScatterPlotMatFrame*>(t)) {
f->OnEditLowessParams(event);
} else if (CovSpFrame* f = dynamic_cast<CovSpFrame*>(t)) {
f->OnEditLowessParams(event);
} else if (CorrelogramFrame* f = dynamic_cast<CorrelogramFrame*>(t)) {
f->OnEditLowessParams(event);
} else if (ConditionalScatterPlotFrame* f =
dynamic_cast<ConditionalScatterPlotFrame*>(t)) {
f->OnEditLowessParams(event);
} else if (DistancePlotFrame* f = dynamic_cast<DistancePlotFrame*>(t)) {
//f->OnEditLowessParams(event);
}
}
void GdaFrame::OnEditVariables(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnEditVariables()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ScatterPlotMatFrame* f = dynamic_cast<ScatterPlotMatFrame*>(t)) {
f->OnShowVarsChooser(event);
} else if (CorrelogramFrame* f = dynamic_cast<CorrelogramFrame*>(t)) {
f->OnShowCorrelParams(event);
} else if (CovSpFrame* f = dynamic_cast<CovSpFrame*>(t)) {
f->OnShowVarsChooser(event);
} else if (LineChartFrame* f = dynamic_cast<LineChartFrame*>(t)) {
//f->OnShowVarsChooser(event);
}
}
void GdaFrame::OnSaveStatsToCsv(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnSaveStatsToCsv()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (CorrelogramFrame* f = dynamic_cast<CorrelogramFrame*>(t)) {
f->OnSaveResult(event);
}
}
void GdaFrame::OnViewRegimesRegression(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnViewRegimesRegression()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LisaScatterPlotFrame* f = dynamic_cast<LisaScatterPlotFrame*>(t)) {
f->OnViewRegimesRegression(event);
} else if (ScatterNewPlotFrame* f = dynamic_cast<ScatterNewPlotFrame*>(t)) {
f->OnViewRegimesRegression(event);
} else if (ScatterPlotMatFrame* f = dynamic_cast<ScatterPlotMatFrame*>(t)) {
f->OnViewRegimesRegression(event);
} else if (CovSpFrame* f = dynamic_cast<CovSpFrame*>(t)) {
f->OnViewRegimesRegression(event);
}
}
void GdaFrame::OnViewRegressionSelectedExcluded(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnViewRegressionSelectedExcluded()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ScatterNewPlotFrame* f = dynamic_cast<ScatterNewPlotFrame*>(t)) {
f->OnViewRegressionSelectedExcluded(event);
}
}
void GdaFrame::OnViewRegressionSelected(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnViewRegressionSelected()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ScatterNewPlotFrame* f = dynamic_cast<ScatterNewPlotFrame*>(t)) {
f->OnViewRegressionSelected(event);
}
}
void GdaFrame::OnCompareRegimes(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnCompareRegimes()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LineChartFrame* f = dynamic_cast<LineChartFrame*>(t)) {
LineChartEventDelay* l=new LineChartEventDelay(f, "ID_COMPARE_REGIMES");
}
}
void GdaFrame::OnCompareTimePeriods(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnCompareTimePeriods()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LineChartFrame* f = dynamic_cast<LineChartFrame*>(t)) {
LineChartEventDelay* l=new LineChartEventDelay(f,"ID_COMPARE_TIME_PERIODS");
}
}
void GdaFrame::OnCompareRegAndTmPer(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnCompareRegAndTmPer()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (LineChartFrame* f = dynamic_cast<LineChartFrame*>(t)) {
LineChartEventDelay* l=
new LineChartEventDelay(f,"ID_COMPARE_REG_AND_TM_PER");
}
}
void GdaFrame::OnDisplayStatistics(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnDisplayStatistics()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ScatterNewPlotFrame* f = dynamic_cast<ScatterNewPlotFrame*>(t)) {
f->OnDisplayStatistics(event);
} else if (BoxPlotFrame* f = dynamic_cast<BoxPlotFrame*>(t)) {
f->OnDisplayStatistics(event);
} else if (HistogramFrame* f = dynamic_cast<HistogramFrame*>(t)) {
f->OnDisplayStatistics(event);
} else if (ConnectivityHistFrame* f =
dynamic_cast<ConnectivityHistFrame*>(t)) {
f->OnDisplayStatistics(event);
} else if (WeightsManFrame* f = dynamic_cast<WeightsManFrame*>(t)) {
f->OnDisplayStatistics(event);
} else if (PCPFrame* f = dynamic_cast<PCPFrame*>(t)) {
f->OnDisplayStatistics(event);
} else if (CorrelogramFrame* f = dynamic_cast<CorrelogramFrame*>(t)) {
f->OnDisplayStatistics(event);
} else if (LineChartFrame* f = dynamic_cast<LineChartFrame*>(t)) {
LineChartEventDelay* l=new LineChartEventDelay(f, "ID_DISPLAY_STATISTICS");
}
}
void GdaFrame::OnShowAxesThroughOrigin(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnShowAxesThroughOrigin()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ScatterNewPlotFrame* f = dynamic_cast<ScatterNewPlotFrame*>(t)) {
f->OnShowAxesThroughOrigin(event);
}
}
void GdaFrame::OnShowAxes(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnShowAxes()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (BoxPlotFrame* f = dynamic_cast<BoxPlotFrame*>(t)) {
f->OnShowAxes(event);
} else if (ConnectivityHistFrame* f =
dynamic_cast<ConnectivityHistFrame*>(t)) {
f->OnShowAxes(event);
} else if (ConditionalHistogramFrame* f =
dynamic_cast<ConditionalHistogramFrame*>(t)) {
f->OnShowAxes(event);
} else if (WeightsManFrame* f = dynamic_cast<WeightsManFrame*>(t)) {
f->OnShowAxes(event);
} else if (HistogramFrame* f = dynamic_cast<HistogramFrame*>(t)) {
f->OnShowAxes(event);
} else if (PCPFrame* f = dynamic_cast<PCPFrame*>(t)) {
f->OnShowAxes(event);
}
}
void GdaFrame::OnDisplayAxesScaleValues(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnDisplayAxesScaleValues()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ConditionalScatterPlotFrame* f =
dynamic_cast<ConditionalScatterPlotFrame*>(t)) {
f->OnDisplayAxesScaleValues(event);
}
}
void GdaFrame::OnDisplaySlopeValues(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnDisplaySlopeValues()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
if (ConditionalScatterPlotFrame* f =
dynamic_cast<ConditionalScatterPlotFrame*>(t)) {
f->OnDisplaySlopeValues(event);
} else if (ScatterPlotMatFrame* f =
dynamic_cast<ScatterPlotMatFrame*>(t)) {
f->OnDisplaySlopeValues(event);
}
}
void GdaFrame::OnTimeSyncVariable(int var_index)
{
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
t->OnTimeSyncVariable(var_index);
}
void GdaFrame::OnTimeSyncVariable1(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnTimeSyncVariable1()");
OnTimeSyncVariable(0);
}
void GdaFrame::OnTimeSyncVariable2(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnTimeSyncVariable2()");
OnTimeSyncVariable(1);
}
void GdaFrame::OnTimeSyncVariable3(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnTimeSyncVariable3()");
OnTimeSyncVariable(2);
}
void GdaFrame::OnTimeSyncVariable4(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnTimeSyncVariable4()");
OnTimeSyncVariable(3);
}
void GdaFrame::OnFixedScaleVariable(int var_index)
{
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
t->OnFixedScaleVariable(var_index);
}
void GdaFrame::OnFixedScaleVariable1(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnFixedScaleVariable1()");
OnFixedScaleVariable(0);
}
void GdaFrame::OnFixedScaleVariable2(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnFixedScaleVariable2()");
OnFixedScaleVariable(1);
}
void GdaFrame::OnFixedScaleVariable3(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnFixedScaleVariable3()");
OnFixedScaleVariable(2);
}
void GdaFrame::OnFixedScaleVariable4(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnFixedScaleVariable4()");
OnFixedScaleVariable(3);
}
void GdaFrame::OnPlotsPerView(int plots_per_view)
{
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
t->OnPlotsPerView(plots_per_view);
}
void GdaFrame::OnPlotsPerView1(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnPlotsPerView1()");
OnPlotsPerView(1);
}
void GdaFrame::OnPlotsPerView2(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnPlotsPerView2()");
OnPlotsPerView(2);
}
void GdaFrame::OnPlotsPerView3(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnPlotsPerView3()");
OnPlotsPerView(3);
}
void GdaFrame::OnPlotsPerView4(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnPlotsPerView4()");
OnPlotsPerView(4);
}
void GdaFrame::OnPlotsPerView5(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnPlotsPerView5()");
OnPlotsPerView(5);
}
void GdaFrame::OnPlotsPerView6(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnPlotsPerView6()");
OnPlotsPerView(6);
}
void GdaFrame::OnPlotsPerView7(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnPlotsPerView7()");
OnPlotsPerView(7);
}
void GdaFrame::OnPlotsPerView8(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnPlotsPerView8()");
OnPlotsPerView(8);
}
void GdaFrame::OnPlotsPerView9(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnPlotsPerView9()");
OnPlotsPerView(9);
}
void GdaFrame::OnPlotsPerView10(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnPlotsPerView10()");
OnPlotsPerView(10);
}
void GdaFrame::OnPlotsPerViewOther(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnPlotsPerView11()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
t->OnPlotsPerViewOther();
}
void GdaFrame::OnPlotsPerViewAll(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnPlotsPerView12()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
t->OnPlotsPerViewAll();
}
void GdaFrame::OnDisplayStatusBar(wxCommandEvent& event)
{
wxLogMessage("In GdaFrame::OnDisplayStatusBar()");
TemplateFrame* t = TemplateFrame::GetActiveFrame();
if (!t) return;
t->OnDisplayStatusBar(event);
}
void GdaFrame::OnReportBug(wxCommandEvent& WXUNUSED(event) )
{
wxLogMessage("In GdaFrame::OnReportBug()");
ReportBugDlg bugDlg(this);
bugDlg.ShowModal();
}
void GdaFrame::OnCheckUpdates(wxCommandEvent& WXUNUSED(event) )
{
wxLogMessage("In GdaFrame::OnCheckUpdates()");
wxString version = AutoUpdate::CheckUpdate();
if (!version.IsEmpty()) {
AutoUpdateDlg dlg(this);
dlg.ShowModal();
} else {
wxMessageDialog msgDlg(this,
_("Your GeoDa is already up-to-date."),
_("No update required"),
wxOK |wxICON_INFORMATION);
msgDlg.ShowModal();
}
}
void GdaFrame::OnCheckTestMode(wxCommandEvent& event)
{
std::string checked = "no";
if (!event.IsChecked()) {
checked = "yes";
}
wxLogMessage("In GdaFrame::OnCheckTestMode():");
OGRDataAdapter::GetInstance().AddEntry("test_mode", checked);
}
void GdaFrame::OnDonate(wxCommandEvent& WXUNUSED(event) )
{
wxString donate_url = "https://giving.uchicago.edu/site/Donation2?1838.donation=form1&df_id=1838&mfc_pref=T&set.Designee=1901";
wxLaunchDefaultBrowser(donate_url);
}
void GdaFrame::OnHelpAbout(wxCommandEvent& WXUNUSED(event) )
{
wxLogMessage("In GdaFrame::OnHelpAbout()");
wxDialog dlg;
wxXmlResource::Get()->LoadDialog(&dlg, this, "IDD_ABOUTBOX");
wxStaticText* cr = dynamic_cast<wxStaticText*>
(wxWindow::FindWindowById(XRCID("ID_COPYRIGHT"), &dlg));
wxString cr_s;
cr_s << wxString::Format(_("Copyright (C) 2011-%d by Luc Anselin"),
Gda::version_year);
if (cr) cr->SetLabelText(cr_s);
wxStaticText* arr = dynamic_cast<wxStaticText*>
(wxWindow::FindWindowById(XRCID("ID_ALL_RIGHTS_RESERVED"), &dlg));
wxString arr_s;
arr_s << _("All Rights Reserved");
if (arr) arr->SetLabelText(arr_s);
wxStaticText* vl = dynamic_cast<wxStaticText*>
(wxWindow::FindWindowById(XRCID("ID_VERSION_LABEL"), &dlg));
wxString vl_s;
vl_s << "GeoDa " << Gda::version_major << "." << Gda::version_minor << ".";
vl_s << Gda::version_build;
if (Gda::version_subbuild > 0) {
vl_s << "." << Gda::version_subbuild;
}
if (Gda::version_type == 0) {
vl_s << " (alpha),";
} else if (Gda::version_type == 1) {
if (Gda::version_night > 0)
vl_s << "-" << Gda::version_night << " (nightly),";
else
vl_s << " (beta),";
} // otherwise assumed to be release
vl_s << " " << Gda::version_day << " ";
if (Gda::version_month == 1) {
vl_s << _("January");
} else if (Gda::version_month == 2) {
vl_s << _("February");
} else if (Gda::version_month == 3) {
vl_s << _("March");
} else if (Gda::version_month == 4) {
vl_s << _("April");
} else if (Gda::version_month == 5) {
vl_s << _("May");
} else if (Gda::version_month == 6) {
vl_s << _("June");
} else if (Gda::version_month == 7) {
vl_s << _("July");
} else if (Gda::version_month == 8) {
vl_s << _("August");
} else if (Gda::version_month == 9) {
vl_s << _("September");
} else if (Gda::version_month == 10) {
vl_s << _("October");
} else if (Gda::version_month == 11) {
vl_s << _("November");
} else {
vl_s << _("December");
}
vl_s << " " << Gda::version_year;
if (vl) vl->SetLabelText(vl_s);
wxButton* btn_donate = dynamic_cast<wxButton*>(wxWindow::FindWindowById(XRCID("wxID_DONATE"), &dlg));
wxButton* btn_update = dynamic_cast<wxButton*>(wxWindow::FindWindowById(XRCID("ID_CHECKUPDATES"), &dlg));
wxCheckBox* chk_testmode_stable = dynamic_cast<wxCheckBox*>(wxWindow::FindWindowById(XRCID("IDC_CHECK_TESTMODE_STABLE"), &dlg));
std::vector<wxString> test_mode = OGRDataAdapter::GetInstance().GetHistory("test_mode");
bool isTestMode = false;
if (!test_mode.empty()) {
if (test_mode[0] == "yes") {
isTestMode = true;
chk_testmode_stable->SetValue(false);
} else {
chk_testmode_stable->SetValue(true);
}
}
btn_donate->Connect(wxEVT_BUTTON, wxCommandEventHandler(GdaFrame::OnDonate), NULL, this);
chk_testmode_stable->Connect(wxEVT_CHECKBOX, wxCommandEventHandler(GdaFrame::OnCheckTestMode), NULL, this);
btn_update->Connect(wxEVT_BUTTON, wxCommandEventHandler(GdaFrame::OnCheckUpdates), NULL, this);
dlg.ShowModal();
}
void GdaFrame::OnTableSetLocale(wxCommandEvent& event)
{
// show a number locale setup dialog, then save it to GDAL global env
LocaleSetupDlg localeDlg(this);
localeDlg.ShowModal();
}
void GdaFrame::OnEncodingUTF8(wxCommandEvent& event)
{
if (!project_p) return;
project_p->GetTableInt()->SetEncoding(wxFONTENCODING_UTF8);
SetEncodingCheckmarks(wxFONTENCODING_UTF8);
}
void GdaFrame::OnEncodingUTF16(wxCommandEvent& event)
{
if (!project_p) return;
project_p->GetTableInt()->SetEncoding(wxFONTENCODING_UTF16LE);
SetEncodingCheckmarks(wxFONTENCODING_UTF16LE);
}
void GdaFrame::OnEncodingWindows1250(wxCommandEvent& event)
{
if (!project_p) return;
project_p->GetTableInt()->SetEncoding(wxFONTENCODING_CP1250);
SetEncodingCheckmarks(wxFONTENCODING_CP1250);
}
void GdaFrame::OnEncodingWindows1251(wxCommandEvent& event)
{
if (!project_p) return;
project_p->GetTableInt()->SetEncoding(wxFONTENCODING_CP1251);
SetEncodingCheckmarks(wxFONTENCODING_CP1251);
}
void GdaFrame::OnEncodingWindows1254(wxCommandEvent& event)
{
if (!project_p) return;
project_p->GetTableInt()->SetEncoding(wxFONTENCODING_CP1254);
SetEncodingCheckmarks(wxFONTENCODING_CP1254);
}
void GdaFrame::OnEncodingWindows1255(wxCommandEvent& event)
{
if (!project_p) return;
project_p->GetTableInt()->SetEncoding(wxFONTENCODING_CP1255);
SetEncodingCheckmarks(wxFONTENCODING_CP1255);
}
void GdaFrame::OnEncodingWindows1256(wxCommandEvent& event)
{
if (!project_p) return;
project_p->GetTableInt()->SetEncoding(wxFONTENCODING_CP1256);
SetEncodingCheckmarks(wxFONTENCODING_CP1256);
}
void GdaFrame::OnEncodingWindows1258(wxCommandEvent& event)
{
if (!project_p) return;
project_p->GetTableInt()->SetEncoding(wxFONTENCODING_CP1258);
SetEncodingCheckmarks(wxFONTENCODING_CP1258);
}
void GdaFrame::OnEncodingCP852(wxCommandEvent& event)
{
if (!project_p) return;
project_p->GetTableInt()->SetEncoding(wxFONTENCODING_CP852);
SetEncodingCheckmarks(wxFONTENCODING_CP852);
}
void GdaFrame::OnEncodingCP866(wxCommandEvent& event)
{
if (!project_p) return;
project_p->GetTableInt()->SetEncoding(wxFONTENCODING_CP866);
SetEncodingCheckmarks(wxFONTENCODING_CP866);
}
void GdaFrame::OnEncodingISO8859_1(wxCommandEvent& event)
{
if (!project_p) return;
project_p->GetTableInt()->SetEncoding(wxFONTENCODING_ISO8859_1);
SetEncodingCheckmarks(wxFONTENCODING_ISO8859_1);
}
void GdaFrame::OnEncodingISO8859_2(wxCommandEvent& event)
{
if (!project_p) return;
project_p->GetTableInt()->SetEncoding(wxFONTENCODING_ISO8859_2);
SetEncodingCheckmarks(wxFONTENCODING_ISO8859_2);
}
void GdaFrame::OnEncodingISO8859_3(wxCommandEvent& event)
{
if (!project_p) return;
project_p->GetTableInt()->SetEncoding(wxFONTENCODING_ISO8859_3);
SetEncodingCheckmarks(wxFONTENCODING_ISO8859_3);
}
void GdaFrame::OnEncodingISO8859_5(wxCommandEvent& event)
{
if (!project_p) return;
project_p->GetTableInt()->SetEncoding(wxFONTENCODING_ISO8859_5);
SetEncodingCheckmarks(wxFONTENCODING_ISO8859_5);
}
void GdaFrame::OnEncodingISO8859_7(wxCommandEvent& event)
{
if (!project_p) return;
project_p->GetTableInt()->SetEncoding(wxFONTENCODING_ISO8859_7);
SetEncodingCheckmarks(wxFONTENCODING_ISO8859_7);
}
void GdaFrame::OnEncodingISO8859_8(wxCommandEvent& event)
{
if (!project_p) return;
project_p->GetTableInt()->SetEncoding(wxFONTENCODING_ISO8859_8);
SetEncodingCheckmarks(wxFONTENCODING_ISO8859_8);
}
void GdaFrame::OnEncodingISO8859_9(wxCommandEvent& event)
{
if (!project_p) return;
project_p->GetTableInt()->SetEncoding(wxFONTENCODING_ISO8859_9);
SetEncodingCheckmarks(wxFONTENCODING_ISO8859_9);
}
void GdaFrame::OnEncodingISO8859_10(wxCommandEvent& event)
{
if (!project_p) return;
project_p->GetTableInt()->SetEncoding(wxFONTENCODING_ISO8859_10);
SetEncodingCheckmarks(wxFONTENCODING_ISO8859_10);
}
void GdaFrame::OnEncodingISO8859_15(wxCommandEvent& event)
{
if (!project_p) return;
project_p->GetTableInt()->SetEncoding(wxFONTENCODING_ISO8859_15);
SetEncodingCheckmarks(wxFONTENCODING_ISO8859_15);
}
void GdaFrame::OnEncodingGB2312(wxCommandEvent& event)
{
if (!project_p) return;
project_p->GetTableInt()->SetEncoding(wxFONTENCODING_GB2312);
SetEncodingCheckmarks(wxFONTENCODING_GB2312);
}
void GdaFrame::OnEncodingBIG5(wxCommandEvent& event)
{
if (!project_p) return;
project_p->GetTableInt()->SetEncoding(wxFONTENCODING_BIG5);
SetEncodingCheckmarks(wxFONTENCODING_BIG5);
}
void GdaFrame::OnEncodingKOI8_R(wxCommandEvent& event)
{
if (!project_p) return;
project_p->GetTableInt()->SetEncoding(wxFONTENCODING_KOI8);
SetEncodingCheckmarks(wxFONTENCODING_KOI8);
}
void GdaFrame::OnEncodingSHIFT_JIS(wxCommandEvent& event)
{
if (!project_p) return;
project_p->GetTableInt()->SetEncoding(wxFONTENCODING_SHIFT_JIS);
SetEncodingCheckmarks(wxFONTENCODING_SHIFT_JIS);
}
void GdaFrame::OnEncodingEUC_JP(wxCommandEvent& event)
{
if (!project_p) return;
project_p->GetTableInt()->SetEncoding(wxFONTENCODING_EUC_JP);
SetEncodingCheckmarks(wxFONTENCODING_EUC_JP);
}
void GdaFrame::OnEncodingEUC_KR(wxCommandEvent& event)
{
if (!project_p) return;
project_p->GetTableInt()->SetEncoding(wxFONTENCODING_EUC_KR);
SetEncodingCheckmarks(wxFONTENCODING_EUC_KR);
}
void GdaFrame::SetEncodingCheckmarks(wxFontEncoding e)
{
wxMenuBar* m = GetMenuBar();
m->FindItem(XRCID("ID_ENCODING_UTF8"))->Check(e==wxFONTENCODING_UTF8);
m->FindItem(XRCID("ID_ENCODING_UTF16"))->Check(e==wxFONTENCODING_UTF16LE);
m->FindItem(XRCID("ID_ENCODING_WINDOWS_1250"))->Check(e==wxFONTENCODING_CP1250);
m->FindItem(XRCID("ID_ENCODING_WINDOWS_1251"))->Check(e==wxFONTENCODING_CP1251);
m->FindItem(XRCID("ID_ENCODING_WINDOWS_1254"))->Check(e==wxFONTENCODING_CP1254);
m->FindItem(XRCID("ID_ENCODING_WINDOWS_1255"))->Check(e==wxFONTENCODING_CP1255);
m->FindItem(XRCID("ID_ENCODING_WINDOWS_1256"))->Check(e==wxFONTENCODING_CP1256);
m->FindItem(XRCID("ID_ENCODING_WINDOWS_1258"))->Check(e==wxFONTENCODING_CP1258);
m->FindItem(XRCID("ID_ENCODING_CP852"))->Check(e==wxFONTENCODING_CP852);
m->FindItem(XRCID("ID_ENCODING_CP866"))->Check(e==wxFONTENCODING_CP866);
m->FindItem(XRCID("ID_ENCODING_ISO_8859_1"))->Check(e==wxFONTENCODING_ISO8859_1);
m->FindItem(XRCID("ID_ENCODING_ISO_8859_2"))->Check(e==wxFONTENCODING_ISO8859_2);
m->FindItem(XRCID("ID_ENCODING_ISO_8859_3"))->Check(e==wxFONTENCODING_ISO8859_3);
m->FindItem(XRCID("ID_ENCODING_ISO_8859_5"))->Check(e==wxFONTENCODING_ISO8859_5);
m->FindItem(XRCID("ID_ENCODING_ISO_8859_7"))->Check(e==wxFONTENCODING_ISO8859_7);
m->FindItem(XRCID("ID_ENCODING_ISO_8859_8"))->Check(e==wxFONTENCODING_ISO8859_8);
m->FindItem(XRCID("ID_ENCODING_ISO_8859_9"))->Check(e==wxFONTENCODING_ISO8859_9);
m->FindItem(XRCID("ID_ENCODING_ISO_8859_10"))->Check(e==wxFONTENCODING_ISO8859_10);
m->FindItem(XRCID("ID_ENCODING_ISO_8859_15"))->Check(e==wxFONTENCODING_ISO8859_15);
m->FindItem(XRCID("ID_ENCODING_GB2312"))->Check(e==wxFONTENCODING_GB2312);
m->FindItem(XRCID("ID_ENCODING_BIG5"))->Check(e==wxFONTENCODING_BIG5);
m->FindItem(XRCID("ID_ENCODING_KOI8_R"))->Check(e==wxFONTENCODING_KOI8);
m->FindItem(XRCID("ID_ENCODING_SHIFT_JIS"))->Check(e==wxFONTENCODING_SHIFT_JIS);
m->FindItem(XRCID("ID_ENCODING_EUC_JP"))->Check(e==wxFONTENCODING_EUC_JP);
m->FindItem(XRCID("ID_ENCODING_EUC_KR"))->Check(e==wxFONTENCODING_EUC_KR);
}
bool GdaFrame::GetHtmlMenuItems()
{
return GetHtmlMenuItemsJson();
}
bool GdaFrame::GetHtmlMenuItemsJson()
{
return true;
}
bool GdaFrame::GetHtmlMenuItemsSqlite()
{
return false;
}
int GdaFrame::sqlite3_GetHtmlMenuItemsCB(void *data, int argc,
char **argv, char **azColName)
{
return 0;
}
LineChartEventDelay::LineChartEventDelay()
: lc_frame(0)
{
}
LineChartEventDelay::LineChartEventDelay(LineChartFrame* lc_frame_,
const wxString& cb_name_)
: lc_frame(lc_frame_), cb_name(cb_name_)
{
StartOnce(100);
}
LineChartEventDelay::~LineChartEventDelay()
{
}
void LineChartEventDelay::Notify() {
Stop();
wxCommandEvent ev;
if (cb_name == "ID_COMPARE_REGIMES") {
lc_frame->OnCompareRegimes(ev);
} else if (cb_name == "ID_COMPARE_TIME_PERIODS") {
lc_frame->OnCompareTimePeriods(ev);
} else if (cb_name == "ID_COMPARE_REG_AND_TM_PER") {
lc_frame->OnCompareRegAndTmPer(ev);
} else if (cb_name == "ID_DISPLAY_STATISTICS") {
lc_frame->OnDisplayStatistics(ev);
} else {
LOG_MSG("No matching callback for cb: " + cb_name);
}
delete this;
}
/*
* This is the top-level window of the application.
*/
BEGIN_EVENT_TABLE(GdaFrame, wxFrame)
EVT_CHAR_HOOK(GdaFrame::OnKeyEvent)
EVT_MENU(XRCID("ID_NEW_PROJECT"), GdaFrame::OnNewProject)
EVT_TOOL(XRCID("ID_NEW_PROJECT"), GdaFrame::OnNewProject)
EVT_MENU(XRCID("ID_OPEN_PROJECT"), GdaFrame::OnOpenProject)
EVT_TOOL(XRCID("ID_OPEN_PROJECT"), GdaFrame::OnOpenProject)
EVT_MENU(XRCID("ID_SAVE_PROJECT"), GdaFrame::OnSaveProject)
EVT_TOOL(XRCID("ID_SAVE_PROJECT"), GdaFrame::OnSaveProject)
EVT_MENU(XRCID("ID_SAVE_AS_PROJECT"), GdaFrame::OnSaveAsProject)
EVT_TOOL(XRCID("ID_SAVE_AS_PROJECT"), GdaFrame::OnSaveAsProject)
EVT_MENU(XRCID("ID_EXPORT_LAYER"), GdaFrame::OnExportToOGR)
//EVT_TOOL(XRCID("ID_EXPORT_LAYER"), GdaFrame::OnExportToOGR)
EVT_MENU(XRCID("ID_EXPORT_SELECTED"), GdaFrame::OnExportSelectedToOGR)
EVT_MENU(XRCID("ID_SHOW_PROJECT_INFO"), GdaFrame::OnShowProjectInfo)
EVT_MENU(XRCID("wxID_PREFERENCES"), GdaFrame::OnPreferenceSetup)
EVT_MENU(XRCID("wxID_CLOSE"), GdaFrame::OnMenuClose)
EVT_MENU(XRCID("ID_CLOSE_PROJECT"), GdaFrame::OnCloseProjectEvt)
EVT_TOOL(XRCID("ID_CLOSE_PROJECT"), GdaFrame::OnCloseProjectEvt)
EVT_BUTTON(XRCID("ID_CLOSE_PROJECT"), GdaFrame::OnCloseProjectEvt)
EVT_CLOSE(GdaFrame::OnClose)
EVT_MENU(XRCID("wxID_EXIT"), GdaFrame::OnQuit)
EVT_MENU(XRCID("ID_SELECT_WITH_RECT"), GdaFrame::OnSelectWithRect)
EVT_MENU(XRCID("ID_SELECT_WITH_CIRCLE"), GdaFrame::OnSelectWithCircle)
EVT_MENU(XRCID("ID_SELECT_WITH_LINE"), GdaFrame::OnSelectWithLine)
EVT_MENU(XRCID("ID_SELECT_WITH_CUSTOM"), GdaFrame::OnSelectWithCustom)
EVT_MENU(XRCID("ID_SELECTION_MODE"), GdaFrame::OnSelectionMode)
EVT_MENU(XRCID("ID_FIT_TO_WINDOW_MODE"), GdaFrame::OnFitToWindowMode)
// Fit-To-Window Mode
EVT_MENU(XRCID("ID_FIXED_ASPECT_RATIO_MODE"), GdaFrame::OnFixedAspectRatioMode)
EVT_MENU(XRCID("ID_ADJUST_AXIS_PRECISION"), GdaFrame::OnSetAxisDisplayPrecision)
EVT_MENU(XRCID("ID_ZOOM_MODE"), GdaFrame::OnZoomMode)
EVT_MENU(XRCID("ID_PAN_MODE"), GdaFrame::OnPanMode)
// Print Canvas State to Log File. Used for debugging.
EVT_MENU(XRCID("ID_PRINT_CANVAS_STATE"), GdaFrame::OnPrintCanvasState)
EVT_MENU(XRCID("ID_CLEAN_BASEMAP"), GdaFrame::OnCleanBasemap)
EVT_MENU(XRCID("ID_NO_BASEMAP"), GdaFrame::OnSetNoBasemap)
EVT_MENU(XRCID("ID_CHANGE_TRANSPARENCY"), GdaFrame::OnChangeMapTransparency)
EVT_MENU(XRCID("ID_BASEMAP_CONF"), GdaFrame::OnBasemapConfig)
EVT_MENU(XRCID("ID_SAVE_CANVAS_IMAGE_AS"), GdaFrame::OnSaveCanvasImageAs)
EVT_MENU(XRCID("ID_SAVE_SELECTED_TO_COLUMN"), GdaFrame::OnSaveSelectedToColumn)
EVT_MENU(XRCID("ID_CANVAS_BACKGROUND_COLOR"), GdaFrame::OnCanvasBackgroundColor)
EVT_MENU(XRCID("ID_LEGEND_USE_SCI_NOTATION"), GdaFrame::OnLegendUseScientificNotation)
EVT_MENU(XRCID("ID_LEGEND_DISPLAY_PRECISION"), GdaFrame::OnLegendDisplayPrecision)
EVT_MENU(XRCID("ID_LEGEND_BACKGROUND_COLOR"), GdaFrame::OnLegendBackgroundColor)
EVT_MENU(XRCID("ID_SELECTABLE_FILL_COLOR"), GdaFrame::OnSelectableFillColor)
EVT_MENU(XRCID("ID_SELECTABLE_OUTLINE_COLOR"), GdaFrame::OnSelectableOutlineColor)
EVT_MENU(XRCID("ID_SELECTABLE_OUTLINE_VISIBLE"), GdaFrame::OnSelectableOutlineVisible)
EVT_MENU(XRCID("ID_MAP_SHOW_MAP_CONTOUR"), GdaFrame::OnShowMapBoundary)
EVT_MENU(XRCID("ID_HIGHLIGHT_COLOR"), GdaFrame::OnHighlightColor)
EVT_MENU(XRCID("ID_COPY_IMAGE_TO_CLIPBOARD"), GdaFrame::OnCopyImageToClipboard)
EVT_MENU(XRCID("ID_COPY_LEGEND_TO_CLIPBOARD"), GdaFrame::OnCopyLegendToClipboard)
EVT_MENU(XRCID("ID_TOOLS_WEIGHTS_MANAGER"), GdaFrame::OnToolsWeightsManager)
EVT_TOOL(XRCID("ID_TOOLS_WEIGHTS_MANAGER"), GdaFrame::OnToolsWeightsManager)
EVT_MENU(XRCID("ID_TOOLS_DATA_PCA"), GdaFrame::OnToolsDataPCA)
EVT_MENU(XRCID("ID_TOOLS_DATA_KMEANS"), GdaFrame::OnToolsDataKMeans)
EVT_MENU(XRCID("ID_TOOLS_DATA_KMEDIANS"), GdaFrame::OnToolsDataKMedians)
EVT_MENU(XRCID("ID_TOOLS_DATA_KMEDOIDS"), GdaFrame::OnToolsDataKMedoids)
EVT_MENU(XRCID("ID_TOOLS_DATA_HCLUSTER"), GdaFrame::OnToolsDataHCluster)
EVT_MENU(XRCID("ID_TOOLS_DATA_HDBSCAN"), GdaFrame::OnToolsDataHDBScan)
EVT_MENU(XRCID("ID_TOOLS_DATA_DBSCAN"), GdaFrame::OnToolsDataDBScan)
EVT_MENU(XRCID("ID_TOOLS_DATA_MAXP"), GdaFrame::OnToolsDataMaxP)
EVT_MENU(XRCID("ID_TOOLS_DATA_AZP"), GdaFrame::OnToolsDataAZP)
EVT_MENU(XRCID("ID_TOOLS_DATA_SKATER"), GdaFrame::OnToolsDataSkater)
EVT_MENU(XRCID("ID_TOOLS_DATA_SCHC"), GdaFrame::OnToolsDataSCHC)
EVT_MENU(XRCID("ID_TOOLS_DATA_SPECTRAL"), GdaFrame::OnToolsDataSpectral)
EVT_MENU(XRCID("ID_TOOLS_DATA_REDCAP"), GdaFrame::OnToolsDataRedcap)
EVT_MENU(XRCID("ID_TOOLS_DATA_MDS"), GdaFrame::OnToolsDataMDS)
EVT_MENU(XRCID("ID_TOOLS_DATA_TSNE"), GdaFrame::OnToolsDataTSNE)
EVT_BUTTON(XRCID("ID_TOOLS_WEIGHTS_MANAGER"), GdaFrame::OnToolsWeightsManager)
EVT_MENU(XRCID("ID_TOOLS_WEIGHTS_CREATE"), GdaFrame::OnToolsWeightsCreate)
EVT_TOOL(XRCID("ID_TOOLS_WEIGHTS_CREATE"), GdaFrame::OnToolsWeightsCreate)
EVT_BUTTON(XRCID("ID_TOOLS_WEIGHTS_CREATE"), GdaFrame::OnToolsWeightsCreate)
EVT_MENU(XRCID("ID_CONNECTIVITY_HIST_VIEW"), GdaFrame::OnConnectivityHistView)
EVT_TOOL(XRCID("ID_CONNECTIVITY_HIST_VIEW"), GdaFrame::OnConnectivityHistView)
EVT_BUTTON(XRCID("ID_CONNECTIVITY_HIST_VIEW"), GdaFrame::OnConnectivityHistView)
EVT_MENU(XRCID("ID_CONNECTIVITY_MAP_VIEW"), GdaFrame::OnConnectivityMapView)
EVT_TOOL(XRCID("ID_CONNECTIVITY_MAP_VIEW"), GdaFrame::OnConnectivityMapView)
EVT_BUTTON(XRCID("ID_CONNECTIVITY_MAP_VIEW"), GdaFrame::OnConnectivityMapView)
EVT_MENU(XRCID("ID_SHOW_AXES"), GdaFrame::OnShowAxes)
EVT_TOOL(XRCID("ID_MAP_CHOICES"), GdaFrame::OnMapChoices)
EVT_MENU(XRCID("ID_SHAPE_POLYGONS_FROM_GRID"), GdaFrame::OnShapePolygonsFromGrid)
EVT_MENU(XRCID("ID_SHAPE_POLYGONS_FROM_BOUNDARY"), GdaFrame::OnShapePolygonsFromBoundary)
EVT_MENU(XRCID("ID_POINTS_FROM_TABLE"), GdaFrame::OnGeneratePointShpFile)
// Table menu items
EVT_MENU(XRCID("ID_SHOW_TIME_CHOOSER"), GdaFrame::OnShowTimeChooser)
EVT_MENU(XRCID("ID_SHOW_DATA_MOVIE"), GdaFrame::OnShowDataMovie)
EVT_TOOL(XRCID("ID_SHOW_DATA_MOVIE"), GdaFrame::OnShowDataMovie)
EVT_BUTTON(XRCID("ID_SHOW_DATA_MOVIE"), GdaFrame::OnShowDataMovie)
EVT_MENU(XRCID("ID_SHOW_CAT_CLASSIF"), GdaFrame::OnShowCatClassif)
EVT_TOOL(XRCID("ID_SHOW_CAT_CLASSIF"), GdaFrame::OnShowCatClassif)
EVT_BUTTON(XRCID("ID_SHOW_CAT_CLASSIF"), GdaFrame::OnShowCatClassif)
EVT_MENU(XRCID("ID_VAR_GROUPING_EDITOR"), GdaFrame::OnVarGroupingEditor)
EVT_MENU(XRCID("ID_TIME_EDITOR"), GdaFrame::OnVarGroupingEditor)
EVT_MENU(XRCID("ID_TABLE_MOVE_SELECTED_TO_TOP"), GdaFrame::OnMoveSelectedToTop)
EVT_MENU(XRCID("ID_TABLE_INVERT_SELECTION"), GdaFrame::OnInvertSelection)
EVT_MENU(XRCID("ID_TABLE_CLEAR_SELECTION"), GdaFrame::OnClearSelection)
EVT_MENU(XRCID("ID_TABLE_RANGE_SELECTION"), GdaFrame::OnRangeSelection)
EVT_MENU(XRCID("ID_TABLE_FIELD_CALCULATION"), GdaFrame::OnFieldCalculation)
EVT_MENU(XRCID("ID_CALCULATOR"), GdaFrame::OnCalculator)
EVT_MENU(XRCID("ID_TABLE_ADD_COLUMN"), GdaFrame::OnAddCol)
EVT_MENU(XRCID("ID_TABLE_DELETE_COLUMN"), GdaFrame::OnDeleteCol)
EVT_MENU(XRCID("ID_TABLE_EDIT_FIELD_PROP"), GdaFrame::OnEditFieldProperties)
//EVT_MENU(XRCID("ID_TABLE_CHANGE_FIELD_TYPE"), GdaFrame::OnChangeFieldType)
EVT_MENU(XRCID("ID_TABLE_MERGE_TABLE_DATA"), GdaFrame::OnMergeTableData)
EVT_MENU(XRCID("ID_TABLE_AGGREGATION_DATA"), GdaFrame::OnAggregateData)
EVT_MENU(XRCID("ID_TABLE_SPATIAL_JOIN"), GdaFrame::OnSpatialJoin)
EVT_MENU(XRCID("ID_SHAPE_DISSOLVE"), GdaFrame::OnDissolve)
EVT_MENU(XRCID("ID_HIERARCHICAL_MAP"), GdaFrame::OnGroupingMap)
EVT_MENU(XRCID("ID_EXPORT_TO_CSV_FILE"), GdaFrame::OnExportToCsvFile) // not used
EVT_MENU(XRCID("ID_REGRESSION_CLASSIC"), GdaFrame::OnRegressionClassic)
EVT_TOOL(XRCID("ID_REGRESSION_CLASSIC"), GdaFrame::OnRegressionClassic)
EVT_TOOL(XRCID("ID_PUBLISH"), GdaFrame::OnPublish)
EVT_TOOL(XRCID("ID_COND_PLOT_CHOICES"), GdaFrame::OnCondPlotChoices)
EVT_TOOL(XRCID("ID_CLUSTERING_CHOICES"), GdaFrame::OnClusteringChoices)
// The following duplicate entries are needed as a workaround to
// make menu enable/disable work for the menu bar when the same menu
// item appears twice.
EVT_MENU(XRCID("ID_SHOW_CONDITIONAL_MAP_VIEW_MAP_MENU"), GdaFrame::OnShowConditionalMapView)
EVT_MENU(XRCID("ID_SHOW_CONDITIONAL_MAP_VIEW"), GdaFrame::OnShowConditionalMapView)
EVT_BUTTON(XRCID("ID_SHOW_CONDITIONAL_MAP_VIEW"), GdaFrame::OnShowConditionalMapView)
EVT_MENU(XRCID("ID_SHOW_CONDITIONAL_SCATTER_VIEW"), GdaFrame::OnShowConditionalScatterView)
EVT_MENU(XRCID("ID_SHOW_CONDITIONAL_BOX_VIEW"), GdaFrame::OnShowConditionalBoxView)
EVT_BUTTON(XRCID("ID_SHOW_CONDITIONAL_SCATTER_VIEW"), GdaFrame::OnShowConditionalScatterView)
EVT_MENU(XRCID("ID_SHOW_CONDITIONAL_HIST_VIEW"), GdaFrame::OnShowConditionalHistView)
EVT_BUTTON(XRCID("ID_SHOW_CONDITIONAL_HIST_VIEW"), GdaFrame::OnShowConditionalHistView)
EVT_MENU(XRCID("ID_SHOW_CARTOGRAM_NEW_VIEW"), GdaFrame::OnShowCartogramNewView)
EVT_TOOL(XRCID("ID_SHOW_CARTOGRAM_NEW_VIEW"), GdaFrame::OnShowCartogramNewView)
EVT_BUTTON(XRCID("ID_SHOW_CARTOGRAM_NEW_VIEW"), GdaFrame::OnShowCartogramNewView)
EVT_MENU(XRCID("ID_CARTOGRAM_IMPROVE_1"), GdaFrame::OnCartogramImprove1)
EVT_MENU(XRCID("ID_CARTOGRAM_IMPROVE_2"), GdaFrame::OnCartogramImprove2)
EVT_MENU(XRCID("ID_CARTOGRAM_IMPROVE_3"), GdaFrame::OnCartogramImprove3)
EVT_MENU(XRCID("ID_CARTOGRAM_IMPROVE_4"), GdaFrame::OnCartogramImprove4)
EVT_MENU(XRCID("ID_CARTOGRAM_IMPROVE_5"), GdaFrame::OnCartogramImprove5)
EVT_MENU(XRCID("ID_CARTOGRAM_IMPROVE_6"), GdaFrame::OnCartogramImprove6)
EVT_MENU(XRCID("ID_OPTIONS_HINGE_15"), GdaFrame::OnHinge15)
EVT_MENU(XRCID("ID_OPTIONS_HINGE_30"), GdaFrame::OnHinge30)
EVT_MENU(XRCID("IDM_HIST"), GdaFrame::OnExploreHist)
EVT_TOOL(XRCID("IDM_HIST"), GdaFrame::OnExploreHist)
EVT_BUTTON(XRCID("IDM_HIST"), GdaFrame::OnExploreHist)
EVT_MENU(XRCID("IDM_SCATTERPLOT"), GdaFrame::OnExploreScatterNewPlot)
EVT_MENU(XRCID("IDM_BUBBLECHART"), GdaFrame::OnExploreBubbleChart)
EVT_MENU(XRCID("IDM_SCATTERPLOT_MAT"), GdaFrame::OnExploreScatterPlotMat)
EVT_MENU(XRCID("IDM_DISTANCE_PLOT"), GdaFrame::OnDistancePlot)
EVT_MENU(XRCID("IDM_COV_SCATTERPLOT"), GdaFrame::OnExploreCovScatterPlot)
EVT_TOOL(XRCID("IDM_SCATTERPLOT"), GdaFrame::OnExploreScatterNewPlot)
EVT_TOOL(XRCID("IDM_BUBBLECHART"), GdaFrame::OnExploreBubbleChart)
EVT_TOOL(XRCID("IDM_SCATTERPLOT_MAT"), GdaFrame::OnExploreScatterPlotMat)
EVT_MENU(XRCID("IDM_CORRELOGRAM"), GdaFrame::OnExploreCorrelogram)
EVT_MENU(XRCID("IDM_CORRELOGRAM"), GdaFrame::OnExploreCorrelogram)
EVT_TOOL(XRCID("ID_CORRELO_MENU"), GdaFrame::OnCorrelogramMenuChoices)
EVT_BUTTON(XRCID("ID_CORRELO_MENU"), GdaFrame::OnExploreCorrelogram)
EVT_TOOL(XRCID("IDM_COV_SCATTERPLOT"), GdaFrame::OnExploreCovScatterPlot)
EVT_BUTTON(XRCID("IDM_SCATTERPLOT"), GdaFrame::OnExploreScatterNewPlot)
EVT_BUTTON(XRCID("IDM_BUBBLECHART"), GdaFrame::OnExploreBubbleChart)
EVT_BUTTON(XRCID("IDM_SCATTERPLOT_MAT"), GdaFrame::OnExploreScatterPlotMat)
EVT_BUTTON(XRCID("IDM_COV_SCATTERPLOT"), GdaFrame::OnExploreCovScatterPlot)
EVT_MENU(XRCID("IDM_BOX"), GdaFrame::OnExploreNewBox)
EVT_TOOL(XRCID("IDM_BOX"), GdaFrame::OnExploreNewBox)
EVT_BUTTON(XRCID("IDM_BOX"), GdaFrame::OnExploreNewBox)
EVT_MENU(XRCID("IDM_PCP"), GdaFrame::OnExplorePCP)
EVT_TOOL(XRCID("IDM_PCP"), GdaFrame::OnExplorePCP)
EVT_BUTTON(XRCID("IDM_PCP"), GdaFrame::OnExplorePCP)
EVT_MENU(XRCID("IDM_3DP"), GdaFrame::OnExplore3DP)
EVT_TOOL(XRCID("IDM_3DP"), GdaFrame::OnExplore3DP)
EVT_BUTTON(XRCID("IDM_3DP"), GdaFrame::OnExplore3DP)
EVT_MENU(XRCID("IDM_LINE_CHART"), GdaFrame::OnExploreLineChart)
EVT_TOOL(XRCID("IDM_LINE_CHART"), GdaFrame::OnExploreLineChart)
EVT_BUTTON(XRCID("IDM_LINE_CHART"), GdaFrame::OnExploreLineChart)
EVT_TOOL(XRCID("IDM_NEW_TABLE"), GdaFrame::OnToolOpenNewTable)
EVT_BUTTON(XRCID("IDM_NEW_TABLE"), GdaFrame::OnToolOpenNewTable)
EVT_TOOL(XRCID("ID_MORAN_MENU"), GdaFrame::OnMoranMenuChoices)
EVT_TOOL(XRCID("ID_TOOLS_MENU"), GdaFrame::OnToolsChoices)
EVT_MENU(XRCID("IDM_MSPL"), GdaFrame::OnOpenMSPL)
EVT_MENU(XRCID("IDM_DMORAN"), GdaFrame::OnOpenDiffMoran)
EVT_MENU(XRCID("IDM_GMORAN"), GdaFrame::OnOpenGMoran)
EVT_MENU(XRCID("IDM_MORAN_EBRATE"), GdaFrame::OnOpenMoranEB)
EVT_TOOL(XRCID("ID_LISA_MENU"), GdaFrame::OnLisaMenuChoices)
EVT_MENU(XRCID("IDM_UNI_LISA"), GdaFrame::OnOpenUniLisa)
EVT_MENU(XRCID("IDM_UNI_MEDIAN_LISA"), GdaFrame::OnOpenUniMedianLisa)
EVT_MENU(XRCID("IDM_MULTI_LISA"), GdaFrame::OnOpenMultiLisa)
EVT_MENU(XRCID("IDM_DIFF_LISA"), GdaFrame::OnOpenDiffLisa)
EVT_MENU(XRCID("IDM_LISA_EBRATE"), GdaFrame::OnOpenLisaEB)
EVT_MENU(XRCID("IDM_UNI_LOCAL_GEARY"), GdaFrame::OnOpenUniLocalGeary)
EVT_MENU(XRCID("IDM_MUL_LOCAL_GEARY"), GdaFrame::OnOpenMultiLocalGeary)
EVT_MENU(XRCID("IDM_UNI_QUANTILE_LISA"), GdaFrame::OnOpenQuantileLisa)
EVT_MENU(XRCID("IDM_MUL_QUANTILE_LISA"), GdaFrame::OnOpenMultiQuantileLisa)
EVT_MENU(XRCID("IDM_UNI_LOCAL_MATCH"), GdaFrame::OnOpenLocalMatch)
EVT_TOOL(XRCID("IDM_GETIS_ORD_MENU"), GdaFrame::OnGetisMenuChoices)
EVT_MENU(XRCID("IDM_LOCAL_G"), GdaFrame::OnOpenGetisOrd)
EVT_MENU(XRCID("IDM_LOCAL_G_STAR"), GdaFrame::OnOpenGetisOrdStar)
EVT_MENU(XRCID("IDM_LOCAL_JOINT_COUNT"), GdaFrame::OnOpenLocalJoinCount)
EVT_MENU(XRCID("IDM_BIV_LJC"), GdaFrame::OnOpenBivariateLJC)
EVT_MENU(XRCID("IDM_MUL_LJC"), GdaFrame::OnOpenMultiLJC)
EVT_MENU(XRCID("ID_VIEW_DISPLAY_PRECISION"),GdaFrame::OnDisplayPrecision)
EVT_MENU(XRCID("ID_HISTOGRAM_INTERVALS"), GdaFrame::OnHistogramIntervals)
EVT_MENU(XRCID("ID_SAVE_CONNECTIVITY_TO_TABLE"), GdaFrame::OnSaveConnectivityToTable)
EVT_MENU(XRCID("ID_SELECT_ISOLATES"), GdaFrame::OnSelectIsolates)
EVT_MENU(XRCID("ID_OPTIONS_RANDOMIZATION_99PERMUTATION"), GdaFrame::OnRan99Per)
EVT_MENU(XRCID("ID_OPTIONS_RANDOMIZATION_199PERMUTATION"), GdaFrame::OnRan199Per)
EVT_MENU(XRCID("ID_OPTIONS_RANDOMIZATION_499PERMUTATION"), GdaFrame::OnRan499Per)
EVT_MENU(XRCID("ID_OPTIONS_RANDOMIZATION_999PERMUTATION"), GdaFrame::OnRan999Per)
EVT_MENU(XRCID("ID_OPTIONS_RANDOMIZATION_OTHER"), GdaFrame::OnRanOtherPer)
EVT_MENU(XRCID("ID_USE_SPECIFIED_SEED"), GdaFrame::OnUseSpecifiedSeed)
EVT_MENU(XRCID("ID_SPECIFY_SEED_DLG"), GdaFrame::OnSpecifySeedDlg)
EVT_MENU(XRCID("ID_SAVE_MORANI"), GdaFrame::OnSaveMoranI)
EVT_MENU(XRCID("ID_SIGNIFICANCE_FILTER_05"), GdaFrame::OnSigFilter05)
EVT_MENU(XRCID("ID_SIGNIFICANCE_FILTER_01"), GdaFrame::OnSigFilter01)
EVT_MENU(XRCID("ID_SIGNIFICANCE_FILTER_001"), GdaFrame::OnSigFilter001)
EVT_MENU(XRCID("ID_SIGNIFICANCE_FILTER_0001"), GdaFrame::OnSigFilter0001)
EVT_MENU(XRCID("ID_SIGNIFICANCE_FILTER_SETUP"), GdaFrame::OnSigFilterSetup)
EVT_MENU(XRCID("ID_SAVE_GETIS_ORD"), GdaFrame::OnSaveGetisOrd)
EVT_MENU(XRCID("ID_SAVE_LISA"), GdaFrame::OnSaveLisa)
EVT_MENU(XRCID("ID_SAVE_COLOCATION"), GdaFrame::OnSaveColocation)
EVT_MENU(XRCID("ID_SELECT_CORES"), GdaFrame::OnSelectCores)
EVT_MENU(XRCID("ID_SHOW_AS_COND_MAP"), GdaFrame::OnShowAsConditionalMap)
EVT_MENU(XRCID("ID_ADD_NEIGHBORS_TO_SELECTION"), GdaFrame::OnAddNeighborToSelection)
EVT_MENU(XRCID("ID_DISPLAY_WEIGHTS_GRAPH"), GdaFrame::OnDisplayWeightsGraph)
EVT_MENU(XRCID("ID_HIDE_MAP_WITH_GRAPH"), GdaFrame::OnDisplayMapWithGraph)
EVT_MENU(XRCID("ID_WEIGHTS_GRAPH_THICKNESS_LIGHT"), GdaFrame::OnChangeGraphThickness)
EVT_MENU(XRCID("ID_WEIGHTS_GRAPH_THICKNESS_NORM"), GdaFrame::OnChangeGraphThickness)
EVT_MENU(XRCID("ID_WEIGHTS_GRAPH_THICKNESS_STRONG"), GdaFrame::OnChangeGraphThickness)
EVT_MENU(XRCID("ID_WEIGHTS_GRAPH_COLOR"), GdaFrame::OnChangeGraphColor)
EVT_MENU(XRCID("ID_CONN_SELECTED_COLOR"), GdaFrame::OnChangeConnSelectedColor)
EVT_MENU(XRCID("ID_CONN_ROOT_SIZE"), GdaFrame::OnChangeConnRootSize)
EVT_MENU(XRCID("ID_CONN_ROOT_COLOR"), GdaFrame::OnChangeConnRootColor)
EVT_MENU(XRCID("ID_CONN_NEIGHBOR_FILL_COLOR"), GdaFrame::OnChangeNeighborFillColor)
EVT_MENU(XRCID("ID_CONN_SELECTED_FILL_COLOR"), GdaFrame::OnChangeConnSelectedFillColor)
EVT_MENU(XRCID("ID_SELECT_NEIGHBORS_OF_CORES"), GdaFrame::OnSelectNeighborsOfCores)
EVT_MENU(XRCID("ID_SELECT_CORES_AND_NEIGHBORS"), GdaFrame::OnSelectCoresAndNeighbors)
EVT_MENU(XRCID("ID_MAP_ADDMEANCENTERS"), GdaFrame::OnAddMeanCenters)
EVT_MENU(XRCID("ID_MAP_ADDCENTROIDS"), GdaFrame::OnAddCentroids)
EVT_MENU(XRCID("ID_DISPLAY_MEAN_CENTERS"), GdaFrame::OnDisplayMeanCenters)
EVT_MENU(XRCID("ID_DISPLAY_CENTROIDS"), GdaFrame::OnDisplayCentroids)
EVT_MENU(XRCID("ID_DISPLAY_VORONOI_DIAGRAM"), GdaFrame::OnDisplayVoronoiDiagram)
EVT_MENU(XRCID("ID_EXPORT_VORONOI"), GdaFrame::OnExportVoronoi)
EVT_MENU(XRCID("ID_EXPORT_MEAN_CNTRS"), GdaFrame::OnExportMeanCntrs)
EVT_MENU(XRCID("ID_EXPORT_CENTROIDS"), GdaFrame::OnExportCentroids)
EVT_MENU(XRCID("ID_SAVE_VORONOI_DUPS_TO_TABLE"), GdaFrame::OnSaveVoronoiDupsToTable)
EVT_MENU(XRCID("ID_NEW_CUSTOM_CAT_CLASSIF_A"), GdaFrame::OnNewCustomCatClassifA)
EVT_MENU(XRCID("ID_NEW_CUSTOM_CAT_CLASSIF_B"), GdaFrame::OnNewCustomCatClassifB)
EVT_MENU(XRCID("ID_NEW_CUSTOM_CAT_CLASSIF_C"), GdaFrame::OnNewCustomCatClassifC)
EVT_MENU(GdaConst::ID_HTML_MENU_ENTRY_CHOICE_0, GdaFrame::OnHtmlEntry0)
EVT_MENU(GdaConst::ID_HTML_MENU_ENTRY_CHOICE_1, GdaFrame::OnHtmlEntry1)
EVT_MENU(GdaConst::ID_HTML_MENU_ENTRY_CHOICE_2, GdaFrame::OnHtmlEntry2)
EVT_MENU(GdaConst::ID_HTML_MENU_ENTRY_CHOICE_3, GdaFrame::OnHtmlEntry3)
EVT_MENU(GdaConst::ID_HTML_MENU_ENTRY_CHOICE_4, GdaFrame::OnHtmlEntry4)
EVT_MENU(GdaConst::ID_HTML_MENU_ENTRY_CHOICE_5, GdaFrame::OnHtmlEntry5)
EVT_MENU(GdaConst::ID_HTML_MENU_ENTRY_CHOICE_6, GdaFrame::OnHtmlEntry6)
EVT_MENU(GdaConst::ID_HTML_MENU_ENTRY_CHOICE_7, GdaFrame::OnHtmlEntry7)
EVT_MENU(GdaConst::ID_HTML_MENU_ENTRY_CHOICE_8, GdaFrame::OnHtmlEntry8)
EVT_MENU(GdaConst::ID_HTML_MENU_ENTRY_CHOICE_9, GdaFrame::OnHtmlEntry9)
EVT_TOOL(XRCID("ID_OPEN_MAPANALYSIS_THEMELESS"), GdaFrame::OnOpenThemelessMap)
EVT_MENU(XRCID("ID_OPEN_MAPANALYSIS_THEMELESS"), GdaFrame::OnOpenThemelessMap)
EVT_MENU(XRCID("ID_MAPANALYSIS_THEMELESS"), GdaFrame::OnThemelessMap)
EVT_MENU(XRCID("ID_COND_VERT_THEMELESS"), GdaFrame::OnCondVertThemelessMap)
EVT_MENU(XRCID("ID_COND_HORIZ_THEMELESS"), GdaFrame::OnCondHorizThemelessMap)
EVT_TOOL(XRCID("ID_OPEN_QUANTILE_1"), GdaFrame::OnOpenQuantile1)
EVT_MENU(XRCID("ID_OPEN_QUANTILE_1"), GdaFrame::OnOpenQuantile1)
EVT_TOOL(XRCID("ID_OPEN_QUANTILE_2"), GdaFrame::OnOpenQuantile2)
EVT_MENU(XRCID("ID_OPEN_QUANTILE_2"), GdaFrame::OnOpenQuantile2)
EVT_TOOL(XRCID("ID_OPEN_QUANTILE_3"), GdaFrame::OnOpenQuantile3)
EVT_MENU(XRCID("ID_OPEN_QUANTILE_3"), GdaFrame::OnOpenQuantile3)
EVT_TOOL(XRCID("ID_OPEN_QUANTILE_4"), GdaFrame::OnOpenQuantile4)
EVT_MENU(XRCID("ID_OPEN_QUANTILE_4"), GdaFrame::OnOpenQuantile4)
EVT_TOOL(XRCID("ID_OPEN_QUANTILE_5"), GdaFrame::OnOpenQuantile5)
EVT_MENU(XRCID("ID_OPEN_QUANTILE_5"), GdaFrame::OnOpenQuantile5)
EVT_TOOL(XRCID("ID_OPEN_QUANTILE_6"), GdaFrame::OnOpenQuantile6)
EVT_MENU(XRCID("ID_OPEN_QUANTILE_6"), GdaFrame::OnOpenQuantile6)
EVT_TOOL(XRCID("ID_OPEN_QUANTILE_7"), GdaFrame::OnOpenQuantile7)
EVT_MENU(XRCID("ID_OPEN_QUANTILE_7"), GdaFrame::OnOpenQuantile7)
EVT_TOOL(XRCID("ID_OPEN_QUANTILE_8"), GdaFrame::OnOpenQuantile8)
EVT_MENU(XRCID("ID_OPEN_QUANTILE_8"), GdaFrame::OnOpenQuantile8)
EVT_TOOL(XRCID("ID_OPEN_QUANTILE_9"), GdaFrame::OnOpenQuantile9)
EVT_MENU(XRCID("ID_OPEN_QUANTILE_9"), GdaFrame::OnOpenQuantile9)
EVT_TOOL(XRCID("ID_OPEN_QUANTILE_10"), GdaFrame::OnOpenQuantile10)
EVT_MENU(XRCID("ID_OPEN_QUANTILE_10"), GdaFrame::OnOpenQuantile10)
EVT_MENU(XRCID("ID_QUANTILE_1"), GdaFrame::OnQuantile1)
EVT_MENU(XRCID("ID_QUANTILE_2"), GdaFrame::OnQuantile2)
EVT_MENU(XRCID("ID_QUANTILE_3"), GdaFrame::OnQuantile3)
EVT_MENU(XRCID("ID_QUANTILE_4"), GdaFrame::OnQuantile4)
EVT_MENU(XRCID("ID_QUANTILE_5"), GdaFrame::OnQuantile5)
EVT_MENU(XRCID("ID_QUANTILE_6"), GdaFrame::OnQuantile6)
EVT_MENU(XRCID("ID_QUANTILE_7"), GdaFrame::OnQuantile7)
EVT_MENU(XRCID("ID_QUANTILE_8"), GdaFrame::OnQuantile8)
EVT_MENU(XRCID("ID_QUANTILE_9"), GdaFrame::OnQuantile9)
EVT_MENU(XRCID("ID_QUANTILE_10"), GdaFrame::OnQuantile10)
EVT_MENU(XRCID("ID_COND_VERT_QUANT_1"), GdaFrame::OnCondVertQuant1)
EVT_MENU(XRCID("ID_COND_VERT_QUANT_2"), GdaFrame::OnCondVertQuant2)
EVT_MENU(XRCID("ID_COND_VERT_QUANT_3"), GdaFrame::OnCondVertQuant3)
EVT_MENU(XRCID("ID_COND_VERT_QUANT_4"), GdaFrame::OnCondVertQuant4)
EVT_MENU(XRCID("ID_COND_VERT_QUANT_5"), GdaFrame::OnCondVertQuant5)
EVT_MENU(XRCID("ID_COND_VERT_QUANT_6"), GdaFrame::OnCondVertQuant6)
EVT_MENU(XRCID("ID_COND_VERT_QUANT_7"), GdaFrame::OnCondVertQuant7)
EVT_MENU(XRCID("ID_COND_VERT_QUANT_8"), GdaFrame::OnCondVertQuant8)
EVT_MENU(XRCID("ID_COND_VERT_QUANT_9"), GdaFrame::OnCondVertQuant9)
EVT_MENU(XRCID("ID_COND_VERT_QUANT_10"), GdaFrame::OnCondVertQuant10)
EVT_MENU(XRCID("ID_COND_HORIZ_QUANT_1"), GdaFrame::OnCondHorizQuant1)
EVT_MENU(XRCID("ID_COND_HORIZ_QUANT_2"), GdaFrame::OnCondHorizQuant2)
EVT_MENU(XRCID("ID_COND_HORIZ_QUANT_3"), GdaFrame::OnCondHorizQuant3)
EVT_MENU(XRCID("ID_COND_HORIZ_QUANT_4"), GdaFrame::OnCondHorizQuant4)
EVT_MENU(XRCID("ID_COND_HORIZ_QUANT_5"), GdaFrame::OnCondHorizQuant5)
EVT_MENU(XRCID("ID_COND_HORIZ_QUANT_6"), GdaFrame::OnCondHorizQuant6)
EVT_MENU(XRCID("ID_COND_HORIZ_QUANT_7"), GdaFrame::OnCondHorizQuant7)
EVT_MENU(XRCID("ID_COND_HORIZ_QUANT_8"), GdaFrame::OnCondHorizQuant8)
EVT_MENU(XRCID("ID_COND_HORIZ_QUANT_9"), GdaFrame::OnCondHorizQuant9)
EVT_MENU(XRCID("ID_COND_HORIZ_QUANT_10"), GdaFrame::OnCondHorizQuant10)
EVT_TOOL(XRCID("ID_OPEN_MAPANALYSIS_CHOROPLETH_PERCENTILE"), GdaFrame::OnOpenPercentile)
EVT_MENU(XRCID("ID_OPEN_MAPANALYSIS_CHOROPLETH_PERCENTILE"), GdaFrame::OnOpenPercentile)
EVT_MENU(XRCID("ID_MAPANALYSIS_CHOROPLETH_PERCENTILE"), GdaFrame::OnPercentile)
EVT_MENU(XRCID("ID_COND_VERT_CHOROPLETH_PERCENTILE"), GdaFrame::OnCondVertPercentile)
EVT_MENU(XRCID("ID_COND_HORIZ_CHOROPLETH_PERCENTILE"), GdaFrame::OnCondHorizPercentile)
EVT_TOOL(XRCID("ID_OPEN_MAPANALYSIS_HINGE_15"), GdaFrame::OnOpenHinge15)
EVT_MENU(XRCID("ID_OPEN_MAPANALYSIS_HINGE_15"), GdaFrame::OnOpenHinge15)
EVT_MENU(XRCID("ID_MAPANALYSIS_HINGE_15"), GdaFrame::OnHinge15)
EVT_MENU(XRCID("ID_COND_VERT_HINGE_15"), GdaFrame::OnCondVertHinge15)
EVT_MENU(XRCID("ID_COND_HORIZ_HINGE_15"), GdaFrame::OnCondHorizHinge15)
EVT_TOOL(XRCID("ID_OPEN_MAPANALYSIS_HINGE_30"), GdaFrame::OnOpenHinge30)
EVT_MENU(XRCID("ID_OPEN_MAPANALYSIS_HINGE_30"), GdaFrame::OnOpenHinge30)
EVT_MENU(XRCID("ID_MAPANALYSIS_HINGE_30"), GdaFrame::OnHinge30)
EVT_MENU(XRCID("ID_COND_VERT_HINGE_30"), GdaFrame::OnCondVertHinge30)
EVT_MENU(XRCID("ID_COND_HORIZ_HINGE_30"), GdaFrame::OnCondHorizHinge30)
EVT_TOOL(XRCID("ID_OPEN_MAPANALYSIS_CHOROPLETH_STDDEV"), GdaFrame::OnOpenStddev)
EVT_MENU(XRCID("ID_OPEN_MAPANALYSIS_CHOROPLETH_STDDEV"), GdaFrame::OnOpenStddev)
EVT_MENU(XRCID("ID_MAPANALYSIS_CHOROPLETH_STDDEV"), GdaFrame::OnStddev)
EVT_MENU(XRCID("ID_COND_VERT_CHOROPLETH_STDDEV"), GdaFrame::OnCondVertStddev)
EVT_MENU(XRCID("ID_COND_HORIZ_CHOROPLETH_STDDEV"), GdaFrame::OnCondHorizStddev)
EVT_TOOL(XRCID("ID_OPEN_MAPANALYSIS_UNIQUE_VALUES"), GdaFrame::OnOpenUniqueValues)
EVT_MENU(XRCID("ID_OPEN_MAPANALYSIS_UNIQUE_VALUES"), GdaFrame::OnOpenUniqueValues)
EVT_MENU(XRCID("ID_MAPANALYSIS_UNIQUE_VALUES"), GdaFrame::OnUniqueValues)
EVT_TOOL(XRCID("ID_OPEN_MAPANALYSIS_COLOCATION"), GdaFrame::OnOpenColocationMap)
EVT_MENU(XRCID("ID_MAPANALYSIS_COLOCATION"), GdaFrame::OnOpenColocationMap)
EVT_MENU(XRCID("ID_COND_VERT_UNIQUE_VALUES"), GdaFrame::OnCondVertUniqueValues)
EVT_MENU(XRCID("ID_COND_HORIZ_UNIQUE_VALUES"), GdaFrame::OnCondHorizUniqueValues)
EVT_TOOL(XRCID("ID_OPEN_NATURAL_BREAKS_1"), GdaFrame::OnOpenNaturalBreaks1)
EVT_MENU(XRCID("ID_OPEN_NATURAL_BREAKS_1"), GdaFrame::OnOpenNaturalBreaks1)
EVT_TOOL(XRCID("ID_OPEN_NATURAL_BREAKS_2"), GdaFrame::OnOpenNaturalBreaks2)
EVT_MENU(XRCID("ID_OPEN_NATURAL_BREAKS_2"), GdaFrame::OnOpenNaturalBreaks2)
EVT_TOOL(XRCID("ID_OPEN_NATURAL_BREAKS_3"), GdaFrame::OnOpenNaturalBreaks3)
EVT_MENU(XRCID("ID_OPEN_NATURAL_BREAKS_3"), GdaFrame::OnOpenNaturalBreaks3)
EVT_TOOL(XRCID("ID_OPEN_NATURAL_BREAKS_4"), GdaFrame::OnOpenNaturalBreaks4)
EVT_MENU(XRCID("ID_OPEN_NATURAL_BREAKS_4"), GdaFrame::OnOpenNaturalBreaks4)
EVT_TOOL(XRCID("ID_OPEN_NATURAL_BREAKS_5"), GdaFrame::OnOpenNaturalBreaks5)
EVT_MENU(XRCID("ID_OPEN_NATURAL_BREAKS_5"), GdaFrame::OnOpenNaturalBreaks5)
EVT_TOOL(XRCID("ID_OPEN_NATURAL_BREAKS_6"), GdaFrame::OnOpenNaturalBreaks6)
EVT_MENU(XRCID("ID_OPEN_NATURAL_BREAKS_6"), GdaFrame::OnOpenNaturalBreaks6)
EVT_TOOL(XRCID("ID_OPEN_NATURAL_BREAKS_7"), GdaFrame::OnOpenNaturalBreaks7)
EVT_MENU(XRCID("ID_OPEN_NATURAL_BREAKS_7"), GdaFrame::OnOpenNaturalBreaks7)
EVT_TOOL(XRCID("ID_OPEN_NATURAL_BREAKS_8"), GdaFrame::OnOpenNaturalBreaks8)
EVT_MENU(XRCID("ID_OPEN_NATURAL_BREAKS_8"), GdaFrame::OnOpenNaturalBreaks8)
EVT_TOOL(XRCID("ID_OPEN_NATURAL_BREAKS_9"), GdaFrame::OnOpenNaturalBreaks9)
EVT_MENU(XRCID("ID_OPEN_NATURAL_BREAKS_9"), GdaFrame::OnOpenNaturalBreaks9)
EVT_TOOL(XRCID("ID_OPEN_NATURAL_BREAKS_10"), GdaFrame::OnOpenNaturalBreaks10)
EVT_MENU(XRCID("ID_OPEN_NATURAL_BREAKS_10"), GdaFrame::OnOpenNaturalBreaks10)
EVT_MENU(XRCID("ID_NATURAL_BREAKS_1"), GdaFrame::OnNaturalBreaks1)
EVT_MENU(XRCID("ID_NATURAL_BREAKS_2"), GdaFrame::OnNaturalBreaks2)
EVT_MENU(XRCID("ID_NATURAL_BREAKS_3"), GdaFrame::OnNaturalBreaks3)
EVT_MENU(XRCID("ID_NATURAL_BREAKS_4"), GdaFrame::OnNaturalBreaks4)
EVT_MENU(XRCID("ID_NATURAL_BREAKS_5"), GdaFrame::OnNaturalBreaks5)
EVT_MENU(XRCID("ID_NATURAL_BREAKS_6"), GdaFrame::OnNaturalBreaks6)
EVT_MENU(XRCID("ID_NATURAL_BREAKS_7"), GdaFrame::OnNaturalBreaks7)
EVT_MENU(XRCID("ID_NATURAL_BREAKS_8"), GdaFrame::OnNaturalBreaks8)
EVT_MENU(XRCID("ID_NATURAL_BREAKS_9"), GdaFrame::OnNaturalBreaks9)
EVT_MENU(XRCID("ID_NATURAL_BREAKS_10"), GdaFrame::OnNaturalBreaks10)
EVT_MENU(XRCID("ID_COND_VERT_NAT_BRKS_1"), GdaFrame::OnCondVertNatBrks1)
EVT_MENU(XRCID("ID_COND_VERT_NAT_BRKS_2"), GdaFrame::OnCondVertNatBrks2)
EVT_MENU(XRCID("ID_COND_VERT_NAT_BRKS_3"), GdaFrame::OnCondVertNatBrks3)
EVT_MENU(XRCID("ID_COND_VERT_NAT_BRKS_4"), GdaFrame::OnCondVertNatBrks4)
EVT_MENU(XRCID("ID_COND_VERT_NAT_BRKS_5"), GdaFrame::OnCondVertNatBrks5)
EVT_MENU(XRCID("ID_COND_VERT_NAT_BRKS_6"), GdaFrame::OnCondVertNatBrks6)
EVT_MENU(XRCID("ID_COND_VERT_NAT_BRKS_7"), GdaFrame::OnCondVertNatBrks7)
EVT_MENU(XRCID("ID_COND_VERT_NAT_BRKS_8"), GdaFrame::OnCondVertNatBrks8)
EVT_MENU(XRCID("ID_COND_VERT_NAT_BRKS_9"), GdaFrame::OnCondVertNatBrks9)
EVT_MENU(XRCID("ID_COND_VERT_NAT_BRKS_10"), GdaFrame::OnCondVertNatBrks10)
EVT_MENU(XRCID("ID_COND_HORIZ_NAT_BRKS_1"), GdaFrame::OnCondHorizNatBrks1)
EVT_MENU(XRCID("ID_COND_HORIZ_NAT_BRKS_2"), GdaFrame::OnCondHorizNatBrks2)
EVT_MENU(XRCID("ID_COND_HORIZ_NAT_BRKS_3"), GdaFrame::OnCondHorizNatBrks3)
EVT_MENU(XRCID("ID_COND_HORIZ_NAT_BRKS_4"), GdaFrame::OnCondHorizNatBrks4)
EVT_MENU(XRCID("ID_COND_HORIZ_NAT_BRKS_5"), GdaFrame::OnCondHorizNatBrks5)
EVT_MENU(XRCID("ID_COND_HORIZ_NAT_BRKS_6"), GdaFrame::OnCondHorizNatBrks6)
EVT_MENU(XRCID("ID_COND_HORIZ_NAT_BRKS_7"), GdaFrame::OnCondHorizNatBrks7)
EVT_MENU(XRCID("ID_COND_HORIZ_NAT_BRKS_8"), GdaFrame::OnCondHorizNatBrks8)
EVT_MENU(XRCID("ID_COND_HORIZ_NAT_BRKS_9"), GdaFrame::OnCondHorizNatBrks9)
EVT_MENU(XRCID("ID_COND_HORIZ_NAT_BRKS_10"), GdaFrame::OnCondHorizNatBrks10)
EVT_TOOL(XRCID("ID_OPEN_EQUAL_INTERVALS_1"), GdaFrame::OnOpenEqualIntervals1)
EVT_MENU(XRCID("ID_OPEN_EQUAL_INTERVALS_1"), GdaFrame::OnOpenEqualIntervals1)
EVT_TOOL(XRCID("ID_OPEN_EQUAL_INTERVALS_2"), GdaFrame::OnOpenEqualIntervals2)
EVT_MENU(XRCID("ID_OPEN_EQUAL_INTERVALS_2"), GdaFrame::OnOpenEqualIntervals2)
EVT_TOOL(XRCID("ID_OPEN_EQUAL_INTERVALS_3"), GdaFrame::OnOpenEqualIntervals3)
EVT_MENU(XRCID("ID_OPEN_EQUAL_INTERVALS_3"), GdaFrame::OnOpenEqualIntervals3)
EVT_TOOL(XRCID("ID_OPEN_EQUAL_INTERVALS_4"), GdaFrame::OnOpenEqualIntervals4)
EVT_MENU(XRCID("ID_OPEN_EQUAL_INTERVALS_4"), GdaFrame::OnOpenEqualIntervals4)
EVT_TOOL(XRCID("ID_OPEN_EQUAL_INTERVALS_5"), GdaFrame::OnOpenEqualIntervals5)
EVT_MENU(XRCID("ID_OPEN_EQUAL_INTERVALS_5"), GdaFrame::OnOpenEqualIntervals5)
EVT_TOOL(XRCID("ID_OPEN_EQUAL_INTERVALS_6"), GdaFrame::OnOpenEqualIntervals6)
EVT_MENU(XRCID("ID_OPEN_EQUAL_INTERVALS_6"), GdaFrame::OnOpenEqualIntervals6)
EVT_TOOL(XRCID("ID_OPEN_EQUAL_INTERVALS_7"), GdaFrame::OnOpenEqualIntervals7)
EVT_MENU(XRCID("ID_OPEN_EQUAL_INTERVALS_7"), GdaFrame::OnOpenEqualIntervals7)
EVT_TOOL(XRCID("ID_OPEN_EQUAL_INTERVALS_8"), GdaFrame::OnOpenEqualIntervals8)
EVT_MENU(XRCID("ID_OPEN_EQUAL_INTERVALS_8"), GdaFrame::OnOpenEqualIntervals8)
EVT_TOOL(XRCID("ID_OPEN_EQUAL_INTERVALS_9"), GdaFrame::OnOpenEqualIntervals9)
EVT_MENU(XRCID("ID_OPEN_EQUAL_INTERVALS_9"), GdaFrame::OnOpenEqualIntervals9)
EVT_TOOL(XRCID("ID_OPEN_EQUAL_INTERVALS_10"), GdaFrame::OnOpenEqualIntervals10)
EVT_MENU(XRCID("ID_OPEN_EQUAL_INTERVALS_10"), GdaFrame::OnOpenEqualIntervals10)
EVT_MENU(XRCID("ID_EQUAL_INTERVALS_1"), GdaFrame::OnEqualIntervals1)
EVT_MENU(XRCID("ID_EQUAL_INTERVALS_2"), GdaFrame::OnEqualIntervals2)
EVT_MENU(XRCID("ID_EQUAL_INTERVALS_3"), GdaFrame::OnEqualIntervals3)
EVT_MENU(XRCID("ID_EQUAL_INTERVALS_4"), GdaFrame::OnEqualIntervals4)
EVT_MENU(XRCID("ID_EQUAL_INTERVALS_5"), GdaFrame::OnEqualIntervals5)
EVT_MENU(XRCID("ID_EQUAL_INTERVALS_6"), GdaFrame::OnEqualIntervals6)
EVT_MENU(XRCID("ID_EQUAL_INTERVALS_7"), GdaFrame::OnEqualIntervals7)
EVT_MENU(XRCID("ID_EQUAL_INTERVALS_8"), GdaFrame::OnEqualIntervals8)
EVT_MENU(XRCID("ID_EQUAL_INTERVALS_9"), GdaFrame::OnEqualIntervals9)
EVT_MENU(XRCID("ID_EQUAL_INTERVALS_10"), GdaFrame::OnEqualIntervals10)
EVT_MENU(XRCID("ID_COND_VERT_EQU_INTS_1"), GdaFrame::OnCondVertEquInts1)
EVT_MENU(XRCID("ID_COND_VERT_EQU_INTS_2"), GdaFrame::OnCondVertEquInts2)
EVT_MENU(XRCID("ID_COND_VERT_EQU_INTS_3"), GdaFrame::OnCondVertEquInts3)
EVT_MENU(XRCID("ID_COND_VERT_EQU_INTS_4"), GdaFrame::OnCondVertEquInts4)
EVT_MENU(XRCID("ID_COND_VERT_EQU_INTS_5"), GdaFrame::OnCondVertEquInts5)
EVT_MENU(XRCID("ID_COND_VERT_EQU_INTS_6"), GdaFrame::OnCondVertEquInts6)
EVT_MENU(XRCID("ID_COND_VERT_EQU_INTS_7"), GdaFrame::OnCondVertEquInts7)
EVT_MENU(XRCID("ID_COND_VERT_EQU_INTS_8"), GdaFrame::OnCondVertEquInts8)
EVT_MENU(XRCID("ID_COND_VERT_EQU_INTS_9"), GdaFrame::OnCondVertEquInts9)
EVT_MENU(XRCID("ID_COND_VERT_EQU_INTS_10"), GdaFrame::OnCondVertEquInts10)
EVT_MENU(XRCID("ID_COND_HORIZ_EQU_INTS_1"), GdaFrame::OnCondHorizEquInts1)
EVT_MENU(XRCID("ID_COND_HORIZ_EQU_INTS_2"), GdaFrame::OnCondHorizEquInts2)
EVT_MENU(XRCID("ID_COND_HORIZ_EQU_INTS_3"), GdaFrame::OnCondHorizEquInts3)
EVT_MENU(XRCID("ID_COND_HORIZ_EQU_INTS_4"), GdaFrame::OnCondHorizEquInts4)
EVT_MENU(XRCID("ID_COND_HORIZ_EQU_INTS_5"), GdaFrame::OnCondHorizEquInts5)
EVT_MENU(XRCID("ID_COND_HORIZ_EQU_INTS_6"), GdaFrame::OnCondHorizEquInts6)
EVT_MENU(XRCID("ID_COND_HORIZ_EQU_INTS_7"), GdaFrame::OnCondHorizEquInts7)
EVT_MENU(XRCID("ID_COND_HORIZ_EQU_INTS_8"), GdaFrame::OnCondHorizEquInts8)
EVT_MENU(XRCID("ID_COND_HORIZ_EQU_INTS_9"), GdaFrame::OnCondHorizEquInts9)
EVT_MENU(XRCID("ID_COND_HORIZ_EQU_INTS_10"), GdaFrame::OnCondHorizEquInts10)
EVT_MENU(XRCID("ID_SAVE_CATEGORIES"), GdaFrame::OnSaveCategories)
EVT_TOOL(XRCID("ID_OPEN_RATES_SMOOTH_RAWRATE"), GdaFrame::OnOpenRawrate)
EVT_MENU(XRCID("ID_OPEN_RATES_SMOOTH_RAWRATE"), GdaFrame::OnOpenRawrate)
EVT_MENU(XRCID("ID_RATES_SMOOTH_RAWRATE"), GdaFrame::OnRawrate)
EVT_TOOL(XRCID("ID_OPEN_RATES_SMOOTH_EXCESSRISK"), GdaFrame::OnOpenExcessrisk)
EVT_MENU(XRCID("ID_OPEN_RATES_SMOOTH_EXCESSRISK"), GdaFrame::OnOpenExcessrisk)
EVT_MENU(XRCID("ID_RATES_SMOOTH_EXCESSRISK"), GdaFrame::OnExcessrisk)
EVT_TOOL(XRCID("ID_OPEN_RATES_EMPIRICAL_BAYES_SMOOTHER"), GdaFrame::OnOpenEmpiricalBayes)
EVT_MENU(XRCID("ID_OPEN_RATES_EMPIRICAL_BAYES_SMOOTHER"), GdaFrame::OnOpenEmpiricalBayes)
EVT_MENU(XRCID("ID_RATES_EMPIRICAL_BAYES_SMOOTHER"), GdaFrame::OnEmpiricalBayes)
EVT_TOOL(XRCID("ID_OPEN_RATES_SPATIAL_RATE_SMOOTHER"), GdaFrame::OnOpenSpatialRate)
EVT_MENU(XRCID("ID_OPEN_RATES_SPATIAL_RATE_SMOOTHER"), GdaFrame::OnOpenSpatialRate)
EVT_MENU(XRCID("ID_RATES_SPATIAL_RATE_SMOOTHER"), GdaFrame::OnSpatialRate)
EVT_TOOL(XRCID("ID_OPEN_RATES_SPATIAL_EMPIRICAL_BAYES"), GdaFrame::OnOpenSpatialEmpiricalBayes)
EVT_MENU(XRCID("ID_OPEN_RATES_SPATIAL_EMPIRICAL_BAYES"), GdaFrame::OnOpenSpatialEmpiricalBayes)
EVT_MENU(XRCID("ID_RATES_SPATIAL_EMPIRICAL_BAYES"), GdaFrame::OnSpatialEmpiricalBayes)
EVT_MENU(XRCID("ID_MAPANALYSIS_SAVERESULTS"), GdaFrame::OnSaveResults)
EVT_MENU(XRCID("ID_VIEW_STANDARDIZED_DATA"), GdaFrame::OnViewStandardizedData)
EVT_MENU(XRCID("ID_VIEW_ORIGINAL_DATA"), GdaFrame::OnViewOriginalData)
EVT_MENU(XRCID("ID_VIEW_LINEAR_SMOOTHER"), GdaFrame::OnViewLinearSmoother)
EVT_MENU(XRCID("ID_VIEW_LOWESS_SMOOTHER"), GdaFrame::OnViewLowessSmoother)
EVT_MENU(XRCID("ID_EDIT_LOWESS_PARAMS"), GdaFrame::OnEditLowessParams)
EVT_MENU(XRCID("ID_EDIT_VARIABLES"), GdaFrame::OnEditVariables)
EVT_MENU(XRCID("ID_SAVE_CORRELOGRAM_STATS"), GdaFrame::OnSaveStatsToCsv)
EVT_MENU(XRCID("ID_VIEW_REGIMES_REGRESSION"), GdaFrame::OnViewRegimesRegression)
EVT_MENU(XRCID("ID_VIEW_REGRESSION_SELECTED"), GdaFrame::OnViewRegressionSelected)
EVT_MENU(XRCID("ID_VIEW_REGRESSION_SELECTED_EXCLUDED"), GdaFrame::OnViewRegressionSelectedExcluded)
EVT_MENU(XRCID("ID_COMPARE_REGIMES"), GdaFrame::OnCompareRegimes)
EVT_MENU(XRCID("ID_COMPARE_TIME_PERIODS"), GdaFrame::OnCompareTimePeriods)
EVT_MENU(XRCID("ID_COMPARE_REG_AND_TM_PER"), GdaFrame::OnCompareRegAndTmPer)
EVT_MENU(XRCID("ID_DISPLAY_STATISTICS"), GdaFrame::OnDisplayStatistics)
EVT_MENU(XRCID("ID_CORRELOGRAM_DISPLAY_STATS"), GdaFrame::OnDisplayStatistics)
EVT_MENU(XRCID("ID_SHOW_AXES_THROUGH_ORIGIN"), GdaFrame::OnShowAxesThroughOrigin)
EVT_MENU(XRCID("ID_DISPLAY_AXES_SCALE_VALUES"), GdaFrame::OnDisplayAxesScaleValues)
EVT_MENU(XRCID("ID_DISPLAY_SLOPE_VALUES"),GdaFrame::OnDisplaySlopeValues)
EVT_MENU(XRCID("ID_TABLE_SET_LOCALE"), GdaFrame::OnTableSetLocale)
EVT_MENU(XRCID("ID_ENCODING_UTF8"), GdaFrame::OnEncodingUTF8)
EVT_MENU(XRCID("ID_ENCODING_UTF16"), GdaFrame::OnEncodingUTF16)
EVT_MENU(XRCID("ID_ENCODING_WINDOWS_1250"), GdaFrame::OnEncodingWindows1250)
EVT_MENU(XRCID("ID_ENCODING_WINDOWS_1251"), GdaFrame::OnEncodingWindows1251)
EVT_MENU(XRCID("ID_ENCODING_WINDOWS_1254"),GdaFrame::OnEncodingWindows1254)
EVT_MENU(XRCID("ID_ENCODING_WINDOWS_1255"),GdaFrame::OnEncodingWindows1255)
EVT_MENU(XRCID("ID_ENCODING_WINDOWS_1256"),GdaFrame::OnEncodingWindows1256)
EVT_MENU(XRCID("ID_ENCODING_WINDOWS_1258"),GdaFrame::OnEncodingWindows1258)
EVT_MENU(XRCID("ID_ENCODING_CP852"), GdaFrame::OnEncodingCP852)
EVT_MENU(XRCID("ID_ENCODING_CP866"), GdaFrame::OnEncodingCP866)
EVT_MENU(XRCID("ID_ENCODING_ISO_8859_1"), GdaFrame::OnEncodingISO8859_1)
EVT_MENU(XRCID("ID_ENCODING_ISO_8859_2"), GdaFrame::OnEncodingISO8859_2)
EVT_MENU(XRCID("ID_ENCODING_ISO_8859_3"), GdaFrame::OnEncodingISO8859_3)
EVT_MENU(XRCID("ID_ENCODING_ISO_8859_5"), GdaFrame::OnEncodingISO8859_5)
EVT_MENU(XRCID("ID_ENCODING_ISO_8859_7"), GdaFrame::OnEncodingISO8859_7)
EVT_MENU(XRCID("ID_ENCODING_ISO_8859_8"), GdaFrame::OnEncodingISO8859_8)
EVT_MENU(XRCID("ID_ENCODING_ISO_8859_9"), GdaFrame::OnEncodingISO8859_9)
EVT_MENU(XRCID("ID_ENCODING_ISO_8859_10"), GdaFrame::OnEncodingISO8859_10)
EVT_MENU(XRCID("ID_ENCODING_ISO_8859_15"), GdaFrame::OnEncodingISO8859_15)
EVT_MENU(XRCID("ID_ENCODING_GB2312"), GdaFrame::OnEncodingGB2312)
EVT_MENU(XRCID("ID_ENCODING_BIG5"), GdaFrame::OnEncodingBIG5)
EVT_MENU(XRCID("ID_ENCODING_KOI8_R"), GdaFrame::OnEncodingKOI8_R)
EVT_MENU(XRCID("ID_ENCODING_SHIFT_JIS"), GdaFrame::OnEncodingSHIFT_JIS)
EVT_MENU(XRCID("ID_ENCODING_EUC_JP"), GdaFrame::OnEncodingEUC_JP)
EVT_MENU(XRCID("ID_ENCODING_EUC_KR"), GdaFrame::OnEncodingEUC_KR)
EVT_MENU(GdaConst::ID_TIME_SYNC_VAR1, GdaFrame::OnTimeSyncVariable1)
EVT_MENU(GdaConst::ID_TIME_SYNC_VAR2, GdaFrame::OnTimeSyncVariable2)
EVT_MENU(GdaConst::ID_TIME_SYNC_VAR3, GdaFrame::OnTimeSyncVariable3)
EVT_MENU(GdaConst::ID_TIME_SYNC_VAR4, GdaFrame::OnTimeSyncVariable4)
EVT_MENU(GdaConst::ID_FIX_SCALE_OVER_TIME_VAR1, GdaFrame::OnFixedScaleVariable1)
EVT_MENU(GdaConst::ID_FIX_SCALE_OVER_TIME_VAR2, GdaFrame::OnFixedScaleVariable2)
EVT_MENU(GdaConst::ID_FIX_SCALE_OVER_TIME_VAR3, GdaFrame::OnFixedScaleVariable3)
EVT_MENU(GdaConst::ID_FIX_SCALE_OVER_TIME_VAR4, GdaFrame::OnFixedScaleVariable4)
EVT_MENU(GdaConst::ID_PLOTS_PER_VIEW_1, GdaFrame::OnPlotsPerView1)
EVT_MENU(GdaConst::ID_PLOTS_PER_VIEW_2, GdaFrame::OnPlotsPerView2)
EVT_MENU(GdaConst::ID_PLOTS_PER_VIEW_3, GdaFrame::OnPlotsPerView3)
EVT_MENU(GdaConst::ID_PLOTS_PER_VIEW_4, GdaFrame::OnPlotsPerView4)
EVT_MENU(GdaConst::ID_PLOTS_PER_VIEW_5, GdaFrame::OnPlotsPerView5)
EVT_MENU(GdaConst::ID_PLOTS_PER_VIEW_6, GdaFrame::OnPlotsPerView6)
EVT_MENU(GdaConst::ID_PLOTS_PER_VIEW_7, GdaFrame::OnPlotsPerView7)
EVT_MENU(GdaConst::ID_PLOTS_PER_VIEW_8, GdaFrame::OnPlotsPerView8)
EVT_MENU(GdaConst::ID_PLOTS_PER_VIEW_9, GdaFrame::OnPlotsPerView9)
EVT_MENU(GdaConst::ID_PLOTS_PER_VIEW_10, GdaFrame::OnPlotsPerView10)
EVT_MENU(GdaConst::ID_PLOTS_PER_VIEW_OTHER, GdaFrame::OnPlotsPerViewOther)
EVT_MENU(GdaConst::ID_PLOTS_PER_VIEW_ALL, GdaFrame::OnPlotsPerViewAll)
EVT_MENU(XRCID("ID_DISPLAY_STATUS_BAR"), GdaFrame::OnDisplayStatusBar)
EVT_MENU(XRCID("wxID_ABOUT"), GdaFrame::OnHelpAbout)
EVT_MENU(XRCID("wxID_DONATE"), GdaFrame::OnDonate)
EVT_MENU(XRCID("wxID_CHECKUPDATES"), GdaFrame::OnCheckUpdates)
EVT_MENU(XRCID("wxID_REPORTBUG"), GdaFrame::OnReportBug)
END_EVENT_TABLE()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/morcc7/geoda.git
[email protected]:morcc7/geoda.git
morcc7
geoda
geoda
master

搜索帮助