% Remember to use the lgrind style

\Head{}
\File{gui.pas}{2007}{4}{14}{23:30}{12974}
\L{\LB{\K{unit}_\V{gui};_}}
\L{\LB{}}
\L{\LB{\C{}\{\$mode_objfpc\}\CE{}\C{}\{\$H+\}\CE{}}}
\L{\LB{}}
\L{\LB{\K{interface}}}
\L{\LB{}}
\L{\LB{\K{uses}}}
\L{\LB{}\Tab{2}{\V{Classes},_\V{SysUtils},_\V{LResources},_\V{Forms},_\V{Controls},_\V{Graphics},_\V{Dialogs},_\V{Grids},}}
\L{\LB{}\Tab{2}{\V{ExtCtrls},_\V{Buttons},\V{logic},_\V{StdCtrls},_\V{ComCtrls},_\V{Menus};}}
\L{\LB{}}
\L{\LB{\K{type}}}
\L{\LB{}}
\L{\LB{}\Tab{2}{\C{}\{_TBidokuForm_\}\CE{}}}
\L{\LB{}}
\L{\LB{}\Tab{2}{\V{TBidokuForm}_=_\K{class}(\V{TForm})}}
\L{\LB{}\Tab{4}{\V{bidokuList}:_\V{TListBox};}}
\L{\LB{}\Tab{4}{\V{ComboBox1}:_\V{TComboBox};}}
\L{\LB{}\Tab{4}{\V{MainMenu1}:_\V{TMainMenu};}}
\L{\LB{}\Tab{4}{\V{MenuItem1}:_\V{TMenuItem};}}
\L{\LB{}\Tab{4}{\V{MenuItem2}:_\V{TMenuItem};}}
\L{\LB{}\Tab{4}{\V{allSolve}:_\V{TMenuItem};}}
\L{\LB{}\Tab{4}{\V{logicSolve}:_\V{TMenuItem};}}
\L{\LB{}\Tab{4}{\V{MenuItem3}:_\V{TMenuItem};}}
\L{\LB{}\Tab{4}{\V{MenuItem4}:_\V{TMenuItem};}}
\L{\LB{}\Tab{4}{\V{MenuItem5}:_\V{TMenuItem};}}
\L{\LB{}\Tab{4}{\V{saveAll}:_\V{TMenuItem};}}
\L{\LB{}\Tab{4}{\V{showSteps}:_\V{TMenuItem};}}
\L{\LB{}\Tab{4}{\V{minizeBidoku}:_\V{TMenuItem};}}
\L{\LB{}\Tab{4}{\V{singleSolve}:_\V{TMenuItem};}}
\L{\LB{}\Tab{4}{\V{saveBidoku}:_\V{TMenuItem};}}
\L{\LB{}\Tab{4}{\V{loadbidoku}:_\V{TMenuItem};}}
\L{\LB{}\Tab{4}{\V{createBidoku}:_\V{TMenuItem};}}
\L{\LB{}\Tab{4}{\V{OpenDialog1}:_\V{TOpenDialog};}}
\L{\LB{}\Tab{4}{\V{Panel2}:_\V{TPanel};}}
\L{\LB{}\Tab{4}{\V{SaveDialog1}:_\V{TSaveDialog};}}
\L{\LB{}\Tab{4}{\V{StatusBar1}:_\V{TStatusBar};}}
\L{\LB{}\Tab{4}{\V{StringGrid1}:_\V{TStringGrid};}}
\index{allSolveClick}\Proc{allSolveClick}\L{\LB{}\Tab{4}{\K{procedure}_\V{allSolveClick}(\V{Sender}:_\V{TObject});}}
\index{ComboBox1Select}\Proc{ComboBox1Select}\L{\LB{}\Tab{4}{\K{procedure}_\V{ComboBox1Select}(\V{Sender}:_\V{TObject});}}
\index{FormCreate}\Proc{FormCreate}\L{\LB{}\Tab{4}{\K{procedure}_\V{FormCreate}(\V{Sender}:_\V{TObject});}}
\index{FormDestroy}\Proc{FormDestroy}\L{\LB{}\Tab{4}{\K{procedure}_\V{FormDestroy}(\V{Sender}:_\V{TObject});}}
\index{bidokuListSelectionChange}\Proc{bidokuListSelectionChange}\L{\LB{}\Tab{4}{\K{procedure}_\V{bidokuListSelectionChange}(\V{Sender}:_\V{TObject};_\V{User}:_\V{boolean});}}
\index{createBidokuClick}\Proc{createBidokuClick}\L{\LB{}\Tab{4}{\K{procedure}_\V{createBidokuClick}(\V{Sender}:_\V{TObject});}}
\index{loadbidokuClick}\Proc{loadbidokuClick}\L{\LB{}\Tab{4}{\K{procedure}_\V{loadbidokuClick}(\V{Sender}:_\V{TObject});}}
\index{logicSolveClick}\Proc{logicSolveClick}\L{\LB{}\Tab{4}{\K{procedure}_\V{logicSolveClick}(\V{Sender}:_\V{TObject});}}
\index{MenuItem3Click}\Proc{MenuItem3Click}\L{\LB{}\Tab{4}{\K{procedure}_\V{MenuItem3Click}(\V{Sender}:_\V{TObject});}}
\index{MenuItem4Click}\Proc{MenuItem4Click}\L{\LB{}\Tab{4}{\K{procedure}_\V{MenuItem4Click}(\V{Sender}:_\V{TObject});}}
\index{MenuItem5Click}\Proc{MenuItem5Click}\L{\LB{}\Tab{4}{\K{procedure}_\V{MenuItem5Click}(\V{Sender}:_\V{TObject});}}
\index{saveAllClick}\Proc{saveAllClick}\L{\LB{}\Tab{4}{\K{procedure}_\V{saveAllClick}(\V{Sender}:_\V{TObject});}}
\index{minizeBidokuClick}\Proc{minizeBidokuClick}\L{\LB{}\Tab{4}{\K{procedure}_\V{minizeBidokuClick}(\V{Sender}:_\V{TObject});}}
\index{saveBidokuClick}\Proc{saveBidokuClick}\L{\LB{}\Tab{4}{\K{procedure}_\V{saveBidokuClick}(\V{Sender}:_\V{TObject});}}
\index{showStepsClick}\Proc{showStepsClick}\L{\LB{}\Tab{4}{\K{procedure}_\V{showStepsClick}(\V{Sender}:_\V{TObject});}}
\index{singleSolveClick}\Proc{singleSolveClick}\L{\LB{}\Tab{4}{\K{procedure}_\V{singleSolveClick}(\V{Sender}:_\V{TObject});}}
\index{StringGrid1DrawCell}\Proc{StringGrid1DrawCell}\L{\LB{}\Tab{4}{\K{procedure}_\V{StringGrid1DrawCell}(\V{Sender}:_\V{TObject};_\V{aCol},_\V{aRow}:_\V{Integer};}}
\L{\LB{}\Tab{6}{\V{aRect}:_\V{TRect};_\V{aState}:_\V{TGridDrawState});}}
\index{StringGrid1EditingDone}\Proc{StringGrid1EditingDone}\L{\LB{}\Tab{4}{\K{procedure}_\V{StringGrid1EditingDone}(\V{Sender}:_\V{TObject});}}
\index{StringGrid1PrepareCanvas}\Proc{StringGrid1PrepareCanvas}\L{\LB{}\Tab{4}{\K{procedure}_\V{StringGrid1PrepareCanvas}(\V{sender}:_\V{TObject};_\V{aCol},_\V{aRow}:_\V{Integer};}}
\L{\LB{}\Tab{6}{\V{aState}:_\V{TGridDrawState});}}
\L{\LB{}\Tab{2}{\K{private}}}
\L{\LB{}\Tab{4}{\C{}\{_private_declarations_\}\CE{}}}
\L{\LB{}\Tab{2}{\K{public}}}
\L{\LB{}\Tab{4}{\C{}\{_public_declarations_\}\CE{}}}
\L{\LB{}\Tab{4}{\V{shownID}:_\V{longint};_\C{}//Bidoku-ID\CE{}}}
\L{\LB{}\Tab{4}{\V{shown}:_\V{TBidoku};}\Tab{22}{\C{}//Aktuelles_Bidoku\CE{}}}
\L{\LB{}\Tab{4}{\C{}//Zeigt_ein_Bidoku_aus_der_Liste_an\CE{}}}
\index{showBidoku}\Proc{showBidoku}\L{\LB{}\Tab{4}{\K{procedure}_\V{showBidoku}(\V{id}:\V{longint}=\-\N{1});}}
\L{\LB{}\Tab{4}{\C{}//Löscht_alle_Bidokus_außer_dem_aktuell_ausgewählten\CE{}}}
\index{needSingleBidoku}\Proc{needSingleBidoku}\L{\LB{}\Tab{4}{\K{procedure}_\V{needSingleBidoku};}}
\L{\LB{}\Tab{2}{\K{end};}}
\L{\LB{}}
\L{\LB{\K{var}}}
\L{\LB{}\Tab{2}{\V{BidokuForm}:_\V{TBidokuForm};}}
\L{\LB{}}
\L{\LB{\K{implementation}}}
\L{\LB{}}
\L{\LB{\K{uses}_\V{createparams},\V{Clipbrd};}}
\L{\LB{\C{}\{_TBidokuForm_\}\CE{}}}
\L{\LB{}}
\L{\LB{\C{}//Initialisierung\CE{}}}
\index{TBidokuForm.FormCreate}\Proc{TBidokuForm.FormCreate}\L{\LB{\K{procedure}_\V{TBidokuForm.FormCreate}(\V{Sender}:_\V{TObject});}}
\L{\LB{\K{begin}}}
\L{\LB{}\Tab{2}{\V{shownID}:=\N{0};}}
\L{\LB{}\Tab{2}{\V{shown}:=\V{TBidoku.create};}}
\L{\LB{}\Tab{2}{\V{bidokuList.Items.AddObject}(\S{}{'}Bidoku{'}\SE{},\V{shown});}}
\L{\LB{}\Tab{2}{\V{ComboBox1.top}:=\V{StatusBar1.top}+\V{StatusBar1.Height};}}
\L{\LB{\K{end};}}
\L{\LB{}}
\L{\LB{\C{}//Berechnet_alle_Lösungen\CE{}}}
\index{TBidokuForm.allSolveClick}\Proc{TBidokuForm.allSolveClick}\L{\LB{\K{procedure}_\V{TBidokuForm.allSolveClick}(\V{Sender}:_\V{TObject});}}
\L{\LB{\K{var}_\V{i}:\V{longint};}}
\L{\LB{}\Tab{4}{\V{solveResult}:_\V{TSolveResult};}}
\L{\LB{\K{begin}}}
\L{\LB{}\Tab{2}{\V{needSingleBidoku};}}
\L{\LB{}\Tab{2}{\V{solveResult}:=\V{shown.solve}(\V{true},\V{true});}}
\L{\LB{}\Tab{2}{\K{if}_\V{solveResult.solved}_\K{then}_\K{begin}}}
\L{\LB{}\Tab{4}{\K{for}_\V{i}:=\N{0}_\K{to}_\V{bidokuList.Items.Count}\-\N{1}_\K{do}}}
\L{\LB{}\Tab{6}{\V{TBidoku}(\V{bidokuList.Items.Objects}[\V{i}])\V{.free};}}
\L{\LB{}\Tab{4}{\V{bidokuList.Clear};}}
\L{\LB{}\Tab{4}{}}
\L{\LB{}\Tab{4}{\K{for}_\V{i}:=\N{0}_\K{to}_\V{solveResult.solutions.count}\-\N{1}_\K{do}}}
\L{\LB{}\Tab{6}{\V{bidokuList.Items.AddObject}(\V{IntToStr}(\V{i}+\N{1})+\S{}{'}._Lösung{'}\SE{},}}
\L{\LB{}\Tab{33}{\V{tobject}(\V{solveResult.solutions}[\V{i}]));}}
\L{\LB{}\Tab{4}{\V{solveResult.solutions.free};}}
\L{\LB{}\Tab{4}{\V{showBidoku}(\N{0});}}
\L{\LB{}}
\L{\LB{}\Tab{4}{\V{ShowMessage}(\S{}{'}Das_Rätsel_wurde_komplett_gelöst{'}\SE{});}}
\L{\LB{}\Tab{2}{\K{end}_\K{else}}}
\L{\LB{}\Tab{4}{\V{ShowMessage}(\S{}{'}Das_Rätsel_ist_unlösbar{'}\SE{});}}
\L{\LB{\K{end};}}
\ProcCont{StringGrid1PrepareCanvas}\L{\LB{}}
\L{\LB{\C{}//Änderung_der_Anzeigeart\CE{}}}
\index{TBidokuForm.ComboBox1Select}\Proc{TBidokuForm.ComboBox1Select}\L{\LB{\K{procedure}_\V{TBidokuForm.ComboBox1Select}(\V{Sender}:_\V{TObject});}}
\L{\LB{\K{begin}}}
\L{\LB{}\Tab{2}{\V{StringGrid1.Refresh};}}
\L{\LB{\K{end};}}
\ProcCont{StringGrid1PrepareCanvas}\L{\LB{}}
\index{TBidokuForm.FormDestroy}\Proc{TBidokuForm.FormDestroy}\L{\LB{\K{procedure}_\V{TBidokuForm.FormDestroy}(\V{Sender}:_\V{TObject});}}
\L{\LB{\K{var}_\V{i}:\V{longint};}}
\L{\LB{\K{begin}}}
\L{\LB{}\Tab{2}{\K{for}_\V{i}:=\N{0}_\K{to}_\V{bidokuList.Items.Count}\-\N{1}_\K{do}}}
\L{\LB{}\Tab{4}{\V{TBidoku}(\V{bidokuList.Items.Objects}[\V{i}])\V{.free};}}
\L{\LB{\K{end};}}
\ProcCont{StringGrid1PrepareCanvas}\L{\LB{}}
\index{TBidokuForm.bidokuListSelectionChange}\Proc{bidokuListSelectionChange}\L{\LB{\K{procedure}_\V{TBidokuForm.bidokuListSelectionChange}(\V{Sender}:_\V{TObject};_\V{User}:_\V{boolean});}}
\L{\LB{\K{begin}}}
\L{\LB{}\Tab{2}{\K{if}_\V{User}_\K{then}_\V{showBidoku}(\V{bidokuList.ItemIndex});}}
\L{\LB{\K{end};}}
\ProcCont{StringGrid1PrepareCanvas}\L{\LB{}}
\L{\LB{\C{}//Erzeugt_ein_neues_Bidoku\CE{}}}
\index{TBidokuForm.createBidokuClick}\Proc{TBidokuForm.createBidokuClick}\L{\LB{\K{procedure}_\V{TBidokuForm.createBidokuClick}(\V{Sender}:_\V{TObject});}}
\L{\LB{\K{var}_\V{sym}:_\V{TPositionsArray};}}
\L{\LB{\K{begin}}}
\L{\LB{}\Tab{2}{\V{CreateParamsDialog.ShowModal};}}
\L{\LB{}}
\L{\LB{}\Tab{2}{\V{shown}:=\V{TBidoku.create}(\V{StrToInt}(\V{CreateParamsDialog.size.text}));}}
\L{\LB{}\Tab{2}{\V{needSingleBidoku};}}
\L{\LB{}\Tab{2}{}}
\L{\LB{}\Tab{2}{\C{}//Muster_setzen\CE{}}}
\L{\LB{}\Tab{2}{\V{sym}:=\K{nil};}}
\L{\LB{}\Tab{2}{\K{with}_\V{CreateParamsDialog},\V{shown}_\K{do}_\K{begin}}}
\L{\LB{}\Tab{4}{\K{if}_\V{horizontal.ItemIndex}\>\N{0}_\K{then}}}
\L{\LB{}\Tab{6}{\V{sym}:=\V{mergeSymmetry}(\V{sym},\V{makeMirrorSymmetryH}(\V{horizontal.ItemIndex}=\N{2}));}}
\L{\LB{}\Tab{4}{\K{if}_\V{subhorizontal.ItemIndex}\>\N{0}_\K{then}}}
\L{\LB{}\Tab{6}{\V{sym}:=\V{mergeSymmetry}(\V{sym},\V{makeMirrorSymmetrySubH}(\V{subhorizontal.ItemIndex}=\N{2}));}}
\L{\LB{}\Tab{4}{\K{if}_\V{vertical.ItemIndex}\>\N{0}_\K{then}}}
\L{\LB{}\Tab{6}{\V{sym}:=\V{mergeSymmetry}(\V{sym},\V{makeMirrorSymmetryV}(\V{vertical.ItemIndex}=\N{2}));}}
\L{\LB{}\Tab{4}{\K{if}_\V{subvertical.ItemIndex}\>\N{0}_\K{then}}}
\L{\LB{}\Tab{6}{\V{sym}:=\V{mergeSymmetry}(\V{sym},\V{makeMirrorSymmetrySubV}(\V{subvertical.ItemIndex}=\N{2}));}}
\L{\LB{}\Tab{2}{\K{end};}}
\ProcCont{StringGrid1PrepareCanvas}\L{\LB{}}
\L{\LB{}\Tab{2}{\C{}//Erzeugen\CE{}}}
\L{\LB{}\Tab{2}{\V{shown.generate}(\V{TDifficulty}(\V{CreateParamsDialog.difficulty.ItemIndex}),\V{sym});}}
\L{\LB{}\Tab{2}{\V{showBidoku};}}
\L{\LB{\K{end};}}
\ProcCont{StringGrid1EditingDone}\L{\LB{}}
\L{\LB{\C{}//Bidoku_laden\CE{}}}
\index{TBidokuForm.loadbidokuClick}\Proc{TBidokuForm.loadbidokuClick}\L{\LB{\K{procedure}_\V{TBidokuForm.loadbidokuClick}(\V{Sender}:_\V{TObject});}}
\L{\LB{\K{begin}}}
\L{\LB{}\Tab{2}{\K{if}_\V{OpenDialog1.Execute}_\K{then}_\K{begin}}}
\L{\LB{}\Tab{4}{\V{needSingleBidoku};}}
\L{\LB{}\Tab{4}{\V{shown.loadFromFile}(\V{OpenDialog1.FileName});}}
\L{\LB{}\Tab{4}{\V{showBidoku};}}
\L{\LB{}\Tab{2}{\K{end};}}
\ProcCont{StringGrid1EditingDone}\L{\LB{\K{end};}}
\ProcCont{StringGrid1DrawCell}\L{\LB{}}
\L{\LB{\C{}//logisches_Lösen_aufrufen\CE{}}}
\index{TBidokuForm.logicSolveClick}\Proc{TBidokuForm.logicSolveClick}\L{\LB{\K{procedure}_\V{TBidokuForm.logicSolveClick}(\V{Sender}:_\V{TObject});}}
\L{\LB{\K{begin}}}
\L{\LB{}\Tab{2}{\V{needSingleBidoku};}}
\L{\LB{}\Tab{2}{\V{shown.logicalSolve}();}}
\L{\LB{}\Tab{2}{\V{showBidoku}(\N{0});}}
\L{\LB{}\Tab{2}{\K{case}_\V{shown.solved}()_\K{of}}}
\L{\LB{}\Tab{4}{\V{ssPartly}:_\V{ShowMessage}(\S{}{'}Das_Rätsel_wurde_nur_teilweise_gelöst{'}\SE{});}}
\L{\LB{}\Tab{4}{\V{ssSolved}:_\V{ShowMessage}(\S{}{'}Das_Rätsel_wurde_komplett_gelöst{'}\SE{});}}
\L{\LB{}\Tab{4}{\V{ssWrong}:_\V{ShowMessage}(\S{}{'}Das_Rätsel_wurde_fehlerhaft_gelöst{'}\SE{});}}
\L{\LB{}\Tab{2}{\K{end};}}
\ProcCont{StringGrid1DrawCell}\L{\LB{\K{end};}}
\ProcCont{singleSolveClick}\L{\LB{}}
\L{\LB{\C{}//Kopieren\CE{}}}
\index{TBidokuForm.MenuItem3Click}\Proc{TBidokuForm.MenuItem3Click}\L{\LB{\K{procedure}_\V{TBidokuForm.MenuItem3Click}(\V{Sender}:_\V{TObject});}}
\L{\LB{\K{begin}}}
\L{\LB{}\Tab{2}{\V{Clipboard.AsText}:=\V{shown.toString}();}}
\L{\LB{\K{end};}}
\ProcCont{singleSolveClick}\L{\LB{}}
\L{\LB{\C{}//Verschlüsseln\CE{}}}
\index{TBidokuForm.MenuItem4Click}\Proc{TBidokuForm.MenuItem4Click}\L{\LB{\K{procedure}_\V{TBidokuForm.MenuItem4Click}(\V{Sender}:_\V{TObject});}}
\L{\LB{\K{var}_\V{str}:_\V{String};}}
\L{\LB{\K{begin}}}
\L{\LB{}\Tab{2}{\K{if}_\V{InputQuery}(\S{}{'}Bidokuverschlüsselung{'}\SE{},}}
\L{\LB{}\Tab{15}{\S{}{'}Bitte_geben_Sie_den_zu_versteckenden_Text_ein:{'}\SE{},\V{str})_\K{then}_\K{begin}}}
\L{\LB{}\Tab{4}{\V{needSingleBidoku};}}
\L{\LB{}\Tab{4}{\V{shown.generateEncryption}(\V{str});}}
\L{\LB{}\Tab{4}{\V{showBidoku}();}}
\L{\LB{}\Tab{2}{\K{end};}}
\ProcCont{singleSolveClick}\L{\LB{\K{end};}}
\ProcCont{showStepsClick}\L{\LB{}}
\L{\LB{\C{}//Entschlüsseln\CE{}}}
\index{TBidokuForm.MenuItem5Click}\Proc{TBidokuForm.MenuItem5Click}\L{\LB{\K{procedure}_\V{TBidokuForm.MenuItem5Click}(\V{Sender}:_\V{TObject});}}
\L{\LB{\K{begin}}}
\L{\LB{}\Tab{2}{\V{ShowMessage}(\V{shown.decode}());}}
\L{\LB{\K{end};}}
\ProcCont{showStepsClick}\L{\LB{}}
\L{\LB{\C{}//Alle_vorhandenen_Bidokus_abspeichern\CE{}}}
\index{TBidokuForm.saveAllClick}\Proc{TBidokuForm.saveAllClick}\L{\LB{\K{procedure}_\V{TBidokuForm.saveAllClick}(\V{Sender}:_\V{TObject});}}
\L{\LB{\K{var}_\V{i}:\V{longint};}}
\L{\LB{\K{begin}}}
\L{\LB{}\Tab{2}{\K{if}_\V{SaveDialog1.Execute}_\K{then}_\K{begin}}}
\L{\LB{}\Tab{4}{\K{for}_\V{i}:=\N{0}_\K{to}_\V{bidokuList.items.count}\-\N{1}_\K{do}}}
\L{\LB{}\Tab{6}{\V{TBidoku}(\V{bidokuList.Items.Objects}[\V{i}])\V{.saveToFile}(}}
\L{\LB{}\Tab{8}{\V{SaveDialog1.FileName}+\V{bidokuList.Items}[\V{i}]);}}
\L{\LB{}\Tab{2}{\K{end};}}
\ProcCont{showStepsClick}\L{\LB{\K{end};}}
\ProcCont{saveBidokuClick}\L{\LB{}}
\L{\LB{\C{}//Bidoku_minimieren\CE{}}}
\index{TBidokuForm.minizeBidokuClick}\Proc{TBidokuForm.minizeBidokuClick}\L{\LB{\K{procedure}_\V{TBidokuForm.minizeBidokuClick}(\V{Sender}:_\V{TObject});}}
\L{\LB{\K{begin}}}
\L{\LB{}\Tab{2}{\V{needSingleBidoku};}}
\L{\LB{}\Tab{2}{\V{shown.minimize};}}
\L{\LB{}\Tab{2}{\V{showBidoku}();}}
\L{\LB{\K{end};}}
\ProcCont{saveBidokuClick}\L{\LB{}}
\L{\LB{\C{}//Bidoku_speichern\CE{}}}
\index{TBidokuForm.saveBidokuClick}\Proc{TBidokuForm.saveBidokuClick}\L{\LB{\K{procedure}_\V{TBidokuForm.saveBidokuClick}(\V{Sender}:_\V{TObject});}}
\L{\LB{\K{begin}}}
\L{\LB{}\Tab{2}{\K{if}_\V{SaveDialog1.Execute}_\K{then}}}
\L{\LB{}\Tab{4}{\V{shown.saveToFile}(\V{SaveDialog1.FileName});}}
\L{\LB{\K{end};}}
\ProcCont{saveBidokuClick}\L{\LB{}}
\L{\LB{\C{}//Zerlegt_ein_Bidoku_in_einzelne_Schritte\CE{}}}
\index{TBidokuForm.showStepsClick}\Proc{TBidokuForm.showStepsClick}\L{\LB{\K{procedure}_\V{TBidokuForm.showStepsClick}(\V{Sender}:_\V{TObject});}}
\L{\LB{\K{var}_\V{current}:\V{TBidoku};}\Tab{25}{\C{}//Aktuelles_Bidoku_mit_teilweise_kopierten_Feldern\CE{}}}
\L{\LB{}\Tab{4}{\V{added}:\V{boolean};}\Tab{25}{\C{}//Wurde_ein_Feld_kopiert\CE{}}}
\L{\LB{}\Tab{4}{\V{i},\V{j},\V{t},\V{bi},\V{bj}:\V{longint};_\C{}//Schleifenindizes,_Zeit_und_frühestes_Feld\CE{}}}
\L{\LB{}}
\L{\LB{\K{begin}}}
\L{\LB{}\Tab{2}{\V{needSingleBidoku};}}
\L{\LB{}\Tab{2}{\V{bidokuList.clear};}}
\L{\LB{}\Tab{2}{\V{current}:=\V{TBidoku.create}(\V{shown.size});}}
\L{\LB{}\Tab{2}{\V{t}:=\-\N{1};}}
\L{\LB{}\Tab{2}{\K{if}_\V{StatusBar1.panels}[\N{0}]\V{.text}=\S{}{'}0{'}\SE{}_\K{then}_\K{begin}}}
\L{\LB{}\Tab{4}{\C{}//Bei_gelösten_Bidokus_nur_die_Lösung_zeigen\CE{}}}
\L{\LB{}\Tab{4}{\K{for}_\V{i}:=\N{0}_\K{to}_\V{shown.size}*\V{shown.size}\-\N{1}_\K{do}}}
\L{\LB{}\Tab{6}{\K{for}_\V{j}:=\N{0}_\K{to}_\V{shown.size}*\V{shown.size}\-\N{1}_\K{do}}}
\L{\LB{}\Tab{8}{\K{if}_(\V{shown.get}(\V{i},\V{j})\<\>\V{triUnset})_\K{and}}}
\L{\LB{}\Tab{11}{(\V{shown.getSolutionMethod}(\V{i},\V{j})=\V{smFixed})_\K{then}_\K{begin}}}
\L{\LB{}\Tab{10}{\V{current.copyField}(\V{i},\V{j},\V{shown});}}
\L{\LB{}\Tab{10}{\K{if}_\V{shown.getSolutionTime}(\V{i},\V{j})\>\V{t}_\K{then}_\V{t}:=\V{shown.getSolutionTime}(\V{i},\V{j});}}
\L{\LB{}\Tab{8}{\K{end};}}
\ProcCont{saveBidokuClick}\L{\LB{}\Tab{4}{\V{bidokuList.Items.AddObject}(\S{}{'}Ausgang{'}\SE{},\V{current});}}
\L{\LB{}\Tab{4}{\V{current}:=\V{current.clone};}}
\L{\LB{}\Tab{2}{\K{end};}}
\ProcCont{minizeBidokuClick}\L{\LB{}\Tab{2}{\C{}//Alle_noch_übrigen,_nicht_kopierten_Felder_in_der_Erstellungsreihenfolge\CE{}}}
\L{\LB{}\Tab{2}{\C{}//kopieren\CE{}}}
\L{\LB{}\Tab{2}{\K{repeat}}}
\L{\LB{}\Tab{4}{\V{added}:=\V{false};}}
\L{\LB{}\Tab{4}{\V{bi}:=\-\N{1};}}
\L{\LB{}\Tab{4}{\C{}//Letztes_erstelltes_suchen\CE{}}}
\L{\LB{}\Tab{4}{\K{for}_\V{i}:=\N{0}_\K{to}_\V{shown.size}*\V{shown.size}\-\N{1}_\K{do}}}
\L{\LB{}\Tab{6}{\K{for}_\V{j}:=\N{0}_\K{to}_\V{shown.size}*\V{shown.size}\-\N{1}_\K{do}}}
\L{\LB{}\Tab{8}{\K{if}_(\V{shown.get}(\V{i},\V{j})\<\>\V{triUnset})_\K{and}_(\V{shown.getSolutionTime}(\V{i},\V{j})\>\V{t})}}
\L{\LB{}\Tab{11}{\K{and}_((\V{bi}=\-\N{1})\K{or}(\V{shown.getSolutionTime}(\V{i},\V{j})\<}}
\L{\LB{}\Tab{26}{\V{shown.getSolutionTime}(\V{bi},\V{bj})))_\K{then}_\K{begin}}}
\L{\LB{}\Tab{10}{\V{bi}:=\V{i};}}
\L{\LB{}\Tab{10}{\V{bj}:=\V{j};}}
\L{\LB{}\Tab{8}{\K{end};}}
\ProcCont{saveAllClick}\L{\LB{}\Tab{4}{\C{}//Feld_kopieren\CE{}}}
\L{\LB{}\Tab{4}{\K{if}_\V{bi}\<\>\-\N{1}_\K{then}_\K{begin}}}
\L{\LB{}\Tab{6}{\V{added}:=\V{true};}}
\L{\LB{}\Tab{6}{\V{t}:=\V{shown.getSolutionTime}(\V{bi},\V{bj});}}
\L{\LB{}\Tab{6}{\V{bidokuList.Items.AddObject}(\V{IntToStr}(\V{t}),\V{current});}}
\L{\LB{}\Tab{6}{\V{current.copyField}(\V{bi},\V{bj},\V{shown});}}
\L{\LB{}\Tab{6}{\V{current}:=\V{current.clone}();}}
\L{\LB{}\Tab{4}{\K{end};}}
\ProcCont{MenuItem5Click}\L{\LB{}\Tab{2}{\K{until}_\K{not}_\V{added};}}
\L{\LB{}\Tab{2}{\V{shown.free};}}
\L{\LB{}\Tab{2}{\V{current.free};}}
\L{\LB{}\Tab{2}{\V{showBidoku}(\N{0});}}
\L{\LB{\K{end};}}
\ProcCont{MenuItem4Click}\L{\LB{}}
\L{\LB{\C{}//Eine_Lösung_finden\CE{}}}
\index{TBidokuForm.singleSolveClick}\Proc{TBidokuForm.singleSolveClick}\L{\LB{\K{procedure}_\V{TBidokuForm.singleSolveClick}(\V{Sender}:_\V{TObject});}}
\L{\LB{\K{begin}}}
\L{\LB{}\Tab{2}{\V{needSingleBidoku};}}
\L{\LB{}\Tab{2}{\V{shown.solve}(\V{false},\V{false});}}
\L{\LB{}\Tab{2}{\V{showBidoku};}}
\L{\LB{}\Tab{2}{\K{case}_\V{shown.solved}()_\K{of}}}
\L{\LB{}\Tab{4}{\V{ssPartly}:_\V{ShowMessage}(\S{}{'}Das_Rätsel_wurde_nur_teilweise_gelöst{'}\SE{});}}
\L{\LB{}\Tab{4}{\V{ssSolved}:_\V{ShowMessage}(\S{}{'}Das_Rätsel_wurde_komplett_gelöst{'}\SE{});}}
\L{\LB{}\Tab{4}{\V{ssWrong}:_\V{ShowMessage}(\S{}{'}Das_Rätsel_wurde_fehlerhaft_gelöst{'}\SE{});}}
\L{\LB{}\Tab{2}{\K{end};}}
\ProcCont{MenuItem4Click}\L{\LB{\K{end};}}
\ProcCont{MenuItem3Click}\L{\LB{}}
\L{\LB{\C{}//Quadratlinien_hervorheben_und_Anzeigemodus_beachten\CE{}}}
\index{TBidokuForm.StringGrid1DrawCell}\Proc{StringGrid1DrawCell}\L{\LB{\K{procedure}_\V{TBidokuForm.StringGrid1DrawCell}(\V{Sender}:_\V{TObject};_\V{aCol},_\V{aRow}:_\V{Integer};}}
\L{\LB{}\Tab{2}{\V{aRect}:_\V{TRect};_\V{aState}:_\V{TGridDrawState});}}
\L{\LB{\K{begin}}}
\L{\LB{}\Tab{2}{\K{if}_\V{arow}_\K{mod}_\V{shown.size}_=_\N{0}_\K{then}_\K{begin}}}
\L{\LB{}\Tab{4}{\V{StringGrid1.Canvas.pen.width}:=\N{3};}}
\L{\LB{}\Tab{4}{\V{StringGrid1.Canvas.pen.color}:=\V{clBlack};}}
\L{\LB{}\Tab{4}{\V{StringGrid1.Canvas.Line}(\V{aRect.Left},\V{aRect.top},_\V{aRect.right},\V{aRect.top});}}
\L{\LB{}\Tab{2}{\K{end};}}
\ProcCont{MenuItem3Click}\L{\LB{}\Tab{2}{\K{if}_\V{arow}_\K{mod}_\V{shown.size}_=_\V{shown.size}\-\N{1}_\K{then}_\K{begin}}}
\L{\LB{}\Tab{4}{\V{StringGrid1.Canvas.pen.width}:=\N{3};}}
\L{\LB{}\Tab{4}{\V{StringGrid1.Canvas.pen.color}:=\V{clBlack};}}
\L{\LB{}\Tab{4}{\V{StringGrid1.Canvas.Line}(\V{aRect.Left},\V{aRect.bottom},_\V{aRect.right},\V{aRect.bottom});}}
\L{\LB{}\Tab{2}{\K{end};}}
\ProcCont{logicSolveClick}\L{\LB{}\Tab{2}{\K{if}_\V{acol}_\K{mod}_\V{shown.size}_=_\N{0}_\K{then}_\K{begin}}}
\L{\LB{}\Tab{4}{\V{StringGrid1.Canvas.pen.width}:=\N{3};}}
\L{\LB{}\Tab{4}{\V{StringGrid1.Canvas.pen.color}:=\V{clBlack};}}
\L{\LB{}\Tab{4}{\V{StringGrid1.Canvas.Line}(\V{aRect.Left},\V{aRect.top},_\V{aRect.left},\V{aRect.bottom});}}
\L{\LB{}\Tab{2}{\K{end};}}
\ProcCont{loadbidokuClick}\L{\LB{}\Tab{2}{\K{if}_\V{acol}_\K{mod}_\V{shown.size}_=_\V{shown.size}\-\N{1}_\K{then}_\K{begin}}}
\L{\LB{}\Tab{4}{\V{StringGrid1.Canvas.pen.width}:=\N{3};}}
\L{\LB{}\Tab{4}{\V{StringGrid1.Canvas.pen.color}:=\V{clBlack};}}
\L{\LB{}\Tab{4}{\V{StringGrid1.Canvas.Line}(\V{aRect.right},\V{aRect.top},_\V{aRect.right},\V{aRect.bottom});}}
\L{\LB{}\Tab{2}{\K{end};}}
\ProcCont{createBidokuClick}\L{\LB{}\Tab{2}{\V{StringGrid1.Canvas.pen.width}:=\N{1};}}
\L{\LB{}\Tab{2}{\V{StringGrid1.Canvas.pen.color}:=\V{clSilver};}}
\L{\LB{}\Tab{2}{\K{if}_\V{ComboBox1.ItemIndex}=\N{1}_\K{then}_\K{begin}}}
\L{\LB{}\Tab{4}{\K{case}_\V{shown.get}(\V{aCol},\V{aRow})_\K{of}}}
\L{\LB{}\Tab{6}{\V{triUnset}:_\V{StringGrid1.Canvas.brush.Color}:=\V{clSilver};}}
\L{\LB{}\Tab{6}{\V{tri0}:_\V{StringGrid1.Canvas.brush.Color}:=\V{clWhite};}}
\L{\LB{}\Tab{6}{\V{tri1}:_\V{StringGrid1.Canvas.brush.Color}:=\V{clBlack};}}
\L{\LB{}\Tab{4}{\K{end};}}
\ProcCont{bidokuListSelectionChange}\L{\LB{}\Tab{4}{\V{StringGrid1.Canvas.FillRect}(\V{arect});}}
\L{\LB{}\Tab{2}{\K{end};}}
\ProcCont{FormDestroy}\L{\LB{\K{end};}}
\ProcCont{FormCreate}\L{\LB{}}
\L{\LB{\C{}//Feldänderung_übernehmen\CE{}}}
\index{TBidokuForm.StringGrid1EditingDone}\Proc{StringGrid1EditingDone}\L{\LB{\K{procedure}_\V{TBidokuForm.StringGrid1EditingDone}(\V{Sender}:_\V{TObject});}}
\L{\LB{\K{var}_\V{i},\V{j}:_\V{longint};}}
\L{\LB{\K{begin}}}
\L{\LB{}\Tab{2}{\K{for}_\V{i}:=\N{0}_\K{to}_\V{StringGrid1.ColCount}\-\N{1}_\K{do}}}
\L{\LB{}\Tab{4}{\K{for}_\V{j}:=\N{0}_\K{to}_\V{StringGrid1.rowCount}\-\N{1}_\K{do}_\K{begin}}}
\L{\LB{}\Tab{6}{\K{if}_\V{StrToIntDef}(\V{StringGrid1.Cells}[\V{i},\V{j}],\-\N{1})+\N{1}\<\>\V{integer}(\V{shown.get}(\V{i},\V{j}))_\K{then}}}
\L{\LB{}\Tab{8}{\K{case}_\V{StrToIntDef}(\V{StringGrid1.Cells}[\V{i},\V{j}],\-\N{1})_\K{of}}}
\L{\LB{}\Tab{10}{\-\N{1}:_\V{shown.put}(\V{i},\V{j},\V{triUnset});}}
\L{\LB{}\Tab{10}{\N{0}:_\V{shown.put}(\V{i},\V{j},\V{tri0});}}
\L{\LB{}\Tab{10}{\N{1}:_\V{shown.put}(\V{i},\V{j},\V{tri1});}}
\L{\LB{}\Tab{8}{\K{end};}}
\ProcCont{FormCreate}\L{\LB{}\Tab{4}{\K{end};}}
\ProcCont{ComboBox1Select}\L{\LB{\K{end};}}
\ProcCont{allSolveClick}\L{\LB{}}
\L{\LB{\C{}//Änderung_der_Schriftfarbe_gemäß_Lösungsmethode_für_ein_Feld\CE{}}}
\index{TBidokuForm.StringGrid1PrepareCanvas}\Proc{StringGrid1PrepareCanvas}\L{\LB{\K{procedure}_\V{TBidokuForm.StringGrid1PrepareCanvas}(\V{sender}:_\V{TObject};_\V{aCol},_\V{aRow}:_\V{Integer};}}
\L{\LB{}\Tab{2}{\V{aState}:_\V{TGridDrawState});}}
\L{\LB{\K{begin}}}
\L{\LB{}\Tab{2}{\K{if}_\V{ComboBox1.ItemIndex}=\N{0}_\K{then}_\K{begin}}}
\L{\LB{}\Tab{4}{\K{case}_\V{shown.getSolutionMethod}(\V{aCol},\V{aRow})_\K{of}}}
\L{\LB{}\Tab{6}{\V{smUser}:_\V{StringGrid1.Canvas.Font.Color}:=\V{clBlue};}}
\L{\LB{}\Tab{6}{\V{smLogicTrivial},\V{smLogicCombined}:_\V{StringGrid1.canvas.font.color}:=\N{\$00aa00};}}
\L{\LB{}\Tab{6}{\V{smBacktracking1}:_\V{StringGrid1.canvas.font.color}:=\N{\$00aaaa};}}
\L{\LB{}\Tab{6}{\V{smBacktracking2}:_\V{StringGrid1.canvas.font.color}:=\V{clRed};}}
\L{\LB{}\Tab{6}{\K{else}_\V{StringGrid1.canvas.font.color}:=\V{clBlack};}}
\L{\LB{}\Tab{4}{\K{end};}}
\ProcCont{allSolveClick}\L{\LB{}\Tab{4}{\K{if}_\V{shown.getSolutionMethod}(\V{aCol},\V{aRow})_\K{in}_[\V{smUser},\V{smUnknown},\V{smFixed}]_\K{then}}}
\L{\LB{}\Tab{6}{\V{StringGrid1.canvas.font.Style}:=[\,]}}
\L{\LB{}\Tab{5}{\K{else}}}
\L{\LB{}\Tab{6}{\V{StringGrid1.canvas.font.Style}:=[\V{fsBold}];}}
\L{\LB{}\Tab{2}{\K{end}_\K{else}_\K{case}_\V{shown.get}(\V{aCol},\V{aRow})_\K{of}}}
\L{\LB{}\Tab{4}{\V{triUnset}:_\V{StringGrid1.Canvas.font.Color}:=\V{clSilver};}}
\L{\LB{}\Tab{4}{\V{tri0}:_\V{StringGrid1.Canvas.font.Color}:=\V{clWhite};}}
\L{\LB{}\Tab{4}{\V{tri1}:_\V{StringGrid1.Canvas.font.Color}:=\V{clBlack};}}
\L{\LB{}\Tab{2}{\K{end};}}
\L{\LB{\K{end};}}
\L{\LB{}}
\L{\LB{\C{}//Zeigt_ein_Bidoku_aus_der_Liste_an\CE{}}}
\index{TBidokuForm.showBidoku}\Proc{TBidokuForm.showBidoku}\L{\LB{\K{procedure}_\V{TBidokuForm.showBidoku}(\V{id}:_\V{longint}=\-\N{1});}}
\L{\LB{\K{var}_\V{i},\V{j},\V{empty}:_\V{longint};}}
\L{\LB{\K{begin}}}
\L{\LB{}\Tab{2}{\C{}//Bidoku_auswählen\CE{}}}
\L{\LB{}\Tab{2}{\K{if}_\V{id}\<\>\-\N{1}_\K{then}_\K{begin}}}
\L{\LB{}\Tab{4}{\V{shownID}:=\V{id};}}
\L{\LB{}\Tab{4}{\V{shown}:=\V{TBidoku}(\V{bidokuList.Items.Objects}[\V{id}]);}}
\L{\LB{}\Tab{2}{\K{end};}}
\L{\LB{}\Tab{2}{\C{}//Größe_überprüfen\CE{}}}
\L{\LB{}\Tab{2}{\K{if}_\V{shown.size}*\V{shown.size}\<\>\V{StringGrid1.ColCount}_\K{then}_\K{begin}}}
\L{\LB{}\Tab{4}{\V{StringGrid1.ColCount}:=\V{shown.size}*\V{shown.size};}}
\L{\LB{}\Tab{4}{\V{StringGrid1.RowCount}:=\V{shown.size}*\V{shown.size};}}
\L{\LB{}\Tab{2}{\K{end};}}
\L{\LB{}}
\L{\LB{}\Tab{2}{\C{}//Felder_kopieren\CE{}}}
\L{\LB{}\Tab{2}{\V{empty}:=\N{0};}}
\L{\LB{}\Tab{2}{\K{for}_\V{i}:=\N{0}_\K{to}_\V{StringGrid1.ColCount}\-\N{1}_\K{do}}}
\L{\LB{}\Tab{4}{\K{for}_\V{j}:=\N{0}_\K{to}_\V{StringGrid1.rowCount}\-\N{1}_\K{do}}}
\L{\LB{}\Tab{6}{\K{case}_\V{shown.get}(\V{i},\V{j})_\K{of}}}
\L{\LB{}\Tab{8}{\V{triUnset}:_\K{begin}}}
\L{\LB{}\Tab{10}{\V{StringGrid1.Cells}[\V{i},\V{j}]:=\S{}{'}{'}\SE{};}}
\L{\LB{}\Tab{10}{\V{empty}+=\N{1};}}
\L{\LB{}\Tab{8}{\K{end};}}
\L{\LB{}\Tab{8}{\V{tri0}:_\V{StringGrid1.Cells}[\V{i},\V{j}]:=\S{}{'}0{'}\SE{};}}
\L{\LB{}\Tab{8}{\V{tri1}:_\V{StringGrid1.Cells}[\V{i},\V{j}]:=\S{}{'}1{'}\SE{};}}
\L{\LB{}\Tab{6}{\K{end};}}
\L{\LB{}\Tab{2}{\C{}//Weitete_Informationen_ausgeben\CE{}}}
\L{\LB{}\Tab{2}{\V{StatusBar1.Panels}[\N{0}]\V{.text}:=\V{IntToStr}(\V{empty});}}
\L{\LB{}\Tab{2}{\K{if}_\V{empty}=\N{0}_\K{then}}}
\L{\LB{}\Tab{4}{\V{StatusBar1.Panels}[\N{2}]\V{.text}:=\S{}{'}Schierigkeit:_{'}\SE{}+\V{IntToStr}(\V{shown.rateDifficulty})}}
\L{\LB{}\Tab{3}{\K{else}}}
\L{\LB{}\Tab{4}{\V{StatusBar1.Panels}[\N{2}]\V{.text}:=\S{}{'}{'}\SE{};}}
\L{\LB{}\Tab{2}{\V{Panel2.Visible}:=\V{bidokuList.items.count}\>\N{1};}}
\L{\LB{\K{end};}}
\L{\LB{}}
\L{\LB{\C{}//Löscht_alle_Bidokus_außer_dem_aktuell_ausgewählten\CE{}}}
\index{TBidokuForm.needSingleBidoku}\Proc{TBidokuForm.needSingleBidoku}\L{\LB{\K{procedure}_\V{TBidokuForm.needSingleBidoku};}}
\L{\LB{\K{var}_\V{i}:\V{longint};}}
\L{\LB{\K{begin}}}
\L{\LB{}\Tab{2}{\K{for}_\V{i}:=\N{0}_\K{to}_\V{bidokuList.items.count}\-\N{1}_\K{do}}}
\L{\LB{}\Tab{4}{\K{if}_\V{i}\<\>\V{shownID}_\K{then}}}
\L{\LB{}\Tab{6}{\V{tbidoku}(\V{bidokuList.Items.Objects}[\V{i}])\V{.free};}}
\L{\LB{}\Tab{2}{\V{bidokuList.Clear};}}
\L{\LB{}\Tab{2}{\V{bidokuList.items.AddObject}(\S{}{'}Bidoku{'}\SE{},\V{shown});}}
\L{\LB{}\Tab{2}{\V{shownID}:=\N{0};}}
\L{\LB{}\Tab{2}{\V{Panel2.Visible}:=\V{false};}}
\L{\LB{\K{end};}}
\L{\LB{}}
\L{\LB{}}
\L{\LB{\K{initialization}}}
\L{\LB{}\Tab{2}{\C{}\{\$I_gui.lrs\}\CE{}}}
\L{\LB{}}
\L{\LB{\K{end.}}}
\L{\LB{}}
