diff options
-rw-r--r-- | raetsel.lpi | 9 | ||||
-rw-r--r-- | raetsel.lps | 120 | ||||
-rw-r--r-- | raetselunit.pas | 43 | ||||
-rw-r--r-- | unit1.lfm | 6 |
4 files changed, 101 insertions, 77 deletions
diff --git a/raetsel.lpi b/raetsel.lpi index 2fc1f94..b896fbb 100644 --- a/raetsel.lpi +++ b/raetsel.lpi @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <CONFIG> <ProjectOptions> - <Version Value="10"/> + <Version Value="11"/> <General> <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> @@ -162,9 +162,10 @@ <Version Value="2"/> </PublishOptions> <RunParams> - <local> - <FormatVersion Value="1"/> - </local> + <FormatVersion Value="2"/> + <Modes Count="1"> + <Mode0 Name="default"/> + </Modes> </RunParams> <RequiredPackages Count="1"> <Item1> diff --git a/raetsel.lps b/raetsel.lps index b73d731..09d01c0 100644 --- a/raetsel.lps +++ b/raetsel.lps @@ -9,7 +9,7 @@ <IsPartOfProject Value="True"/> <EditorIndex Value="2"/> <CursorPos X="30" Y="19"/> - <UsageCount Value="65"/> + <UsageCount Value="73"/> <Loaded Value="True"/> </Unit0> <Unit1> @@ -18,9 +18,8 @@ <ComponentName Value="Form1"/> <HasResources Value="True"/> <ResourceBaseClass Value="Form"/> - <TopLine Value="15"/> - <CursorPos X="59" Y="55"/> - <UsageCount Value="65"/> + <CursorPos Y="16"/> + <UsageCount Value="73"/> <Loaded Value="True"/> <LoadedDesigner Value="True"/> </Unit1> @@ -33,56 +32,54 @@ <UnitName Value="Unit2"/> <EditorIndex Value="-1"/> <CursorPos X="11" Y="27"/> - <UsageCount Value="64"/> + <UsageCount Value="72"/> </Unit2> <Unit3> <Filename Value="raetselunit.pas"/> <IsPartOfProject Value="True"/> <IsVisibleTab Value="True"/> <EditorIndex Value="1"/> - <TopLine Value="669"/> - <CursorPos X="5" Y="684"/> - <UsageCount Value="59"/> + <TopLine Value="378"/> + <CursorPos X="56" Y="389"/> + <UsageCount Value="67"/> <Loaded Value="True"/> </Unit3> <Unit4> <Filename Value="raetselunit.inc"/> <IsPartOfProject Value="True"/> <EditorIndex Value="6"/> - <TopLine Value="260"/> - <CursorPos Y="277"/> - <UsageCount Value="45"/> + <UsageCount Value="53"/> <Loaded Value="True"/> </Unit4> <Unit5> <Filename Value="buchstabenunit.pas"/> <EditorIndex Value="-1"/> <CursorPos Y="18"/> - <UsageCount Value="23"/> + <UsageCount Value="22"/> </Unit5> <Unit6> <Filename Value="hochhausunit.pas"/> <EditorIndex Value="-1"/> <CursorPos Y="18"/> - <UsageCount Value="23"/> + <UsageCount Value="22"/> </Unit6> <Unit7> <Filename Value="Unit1.pas"/> <EditorIndex Value="-1"/> <CursorPos X="3" Y="17"/> - <UsageCount Value="8"/> + <UsageCount Value="7"/> </Unit7> <Unit8> <Filename Value="RaetselFileUnit.pas"/> <UnitName Value="raetselFileUnit"/> <EditorIndex Value="-1"/> - <UsageCount Value="8"/> + <UsageCount Value="7"/> </Unit8> <Unit9> <Filename Value="raetselFileUnit.pas"/> <EditorIndex Value="-1"/> <CursorPos X="28" Y="11"/> - <UsageCount Value="8"/> + <UsageCount Value="7"/> </Unit9> <Unit10> <Filename Value="ori_Unit1.pas"/> @@ -93,7 +90,7 @@ <EditorIndex Value="-1"/> <TopLine Value="2341"/> <CursorPos X="13" Y="2380"/> - <UsageCount Value="21"/> + <UsageCount Value="20"/> </Unit10> <Unit11> <Filename Value="/usr/share/lazarus/lcl/stdctrls.pp"/> @@ -101,7 +98,7 @@ <EditorIndex Value="-1"/> <TopLine Value="1255"/> <CursorPos X="3" Y="1277"/> - <UsageCount Value="8"/> + <UsageCount Value="7"/> </Unit11> <Unit12> <Filename Value="/usr/share/lazarus/lcl/dialogs.pp"/> @@ -109,13 +106,12 @@ <EditorIndex Value="-1"/> <TopLine Value="487"/> <CursorPos X="10" Y="509"/> - <UsageCount Value="9"/> + <UsageCount Value="8"/> </Unit12> <Unit13> <Filename Value="../units/lowlevelunit.pas"/> <EditorIndex Value="4"/> - <TopLine Value="163"/> - <UsageCount Value="10"/> + <UsageCount Value="14"/> <Loaded Value="True"/> </Unit13> <Unit14> @@ -123,38 +119,38 @@ <EditorIndex Value="-1"/> <TopLine Value="1681"/> <CursorPos X="16" Y="1705"/> - <UsageCount Value="10"/> + <UsageCount Value="9"/> </Unit14> <Unit15> <Filename Value="../units/matheunit.pas"/> <EditorIndex Value="5"/> <TopLine Value="307"/> <CursorPos X="9" Y="327"/> - <UsageCount Value="10"/> + <UsageCount Value="14"/> <Loaded Value="True"/> </Unit15> <Unit16> <Filename Value="/usr/lib/fpc/src/packages/gmp/src/gmp.pas"/> <EditorIndex Value="-1"/> - <UsageCount Value="10"/> + <UsageCount Value="9"/> </Unit16> <Unit17> <Filename Value="../units/systemunit.pas"/> <EditorIndex Value="-1"/> - <UsageCount Value="10"/> + <UsageCount Value="9"/> </Unit17> <Unit18> <Filename Value="../units/advanced_matheunit.pas"/> <EditorIndex Value="-1"/> <CursorPos Y="38"/> - <UsageCount Value="20"/> + <UsageCount Value="19"/> </Unit18> <Unit19> <Filename Value="../units/mystringlistunit.pas"/> <EditorIndex Value="3"/> <TopLine Value="22"/> <CursorPos X="59" Y="58"/> - <UsageCount Value="10"/> + <UsageCount Value="14"/> <Loaded Value="True"/> </Unit19> </Units> @@ -164,122 +160,120 @@ <JumpHistory Count="30" HistoryIndex="29"> <Position1> <Filename Value="raetselunit.pas"/> - <Caret Line="405" Column="38" TopLine="393"/> + <Caret Line="568" Column="11" TopLine="541"/> </Position1> <Position2> <Filename Value="raetselunit.pas"/> - <Caret Line="406" Column="31" TopLine="393"/> + <Caret Line="688" Column="11" TopLine="661"/> </Position2> <Position3> - <Filename Value="raetselunit.pas"/> - <Caret Line="407" Column="14" TopLine="393"/> + <Filename Value="raetselunit.inc"/> + <Caret Line="737" Column="37" TopLine="725"/> </Position3> <Position4> <Filename Value="raetselunit.pas"/> - <Caret Line="408" Column="14" TopLine="393"/> + <Caret Line="746" Column="34" TopLine="744"/> </Position4> <Position5> <Filename Value="raetselunit.pas"/> - <Caret Line="413" Column="19" TopLine="393"/> </Position5> <Position6> <Filename Value="raetselunit.pas"/> - <Caret Line="419" Column="46" TopLine="393"/> + <Caret Line="76" Column="23" TopLine="49"/> </Position6> <Position7> <Filename Value="raetselunit.pas"/> - <Caret Line="423" Column="30" TopLine="396"/> + <Caret Line="116" Column="40" TopLine="89"/> </Position7> <Position8> <Filename Value="raetselunit.pas"/> - <Caret Line="89" Column="29" TopLine="69"/> + <Caret Line="351" Column="12" TopLine="324"/> </Position8> <Position9> <Filename Value="raetselunit.pas"/> - <Caret Line="423" Column="32" TopLine="391"/> </Position9> <Position10> <Filename Value="raetselunit.pas"/> - <Caret Line="464" Column="16" TopLine="438"/> + <Caret Line="76" Column="46" TopLine="49"/> </Position10> <Position11> <Filename Value="raetselunit.pas"/> - <Caret Line="92" Column="34" TopLine="72"/> + <Caret Line="116" Column="46" TopLine="89"/> </Position11> <Position12> <Filename Value="raetselunit.pas"/> - <Caret Line="448" Column="22" TopLine="416"/> + <Caret Line="351" Column="11" TopLine="324"/> </Position12> <Position13> <Filename Value="raetselunit.pas"/> - <Caret Line="464" Column="24" TopLine="432"/> + <Caret Line="381" Column="13" TopLine="354"/> </Position13> <Position14> <Filename Value="raetselunit.pas"/> - <Caret Line="544" Column="14" TopLine="513"/> + <Caret Line="392" Column="13" TopLine="365"/> </Position14> <Position15> <Filename Value="raetselunit.pas"/> - <Caret Line="101" Column="36" TopLine="83"/> + <Caret Line="513" Column="11" TopLine="486"/> </Position15> <Position16> <Filename Value="raetselunit.pas"/> - <Caret Line="544" Column="24" TopLine="512"/> + <Caret Line="392" Column="43" TopLine="377"/> </Position16> <Position17> <Filename Value="raetselunit.pas"/> - <Caret Line="895" Column="31" TopLine="872"/> + <Caret Line="514" Column="11" TopLine="487"/> </Position17> <Position18> <Filename Value="raetselunit.pas"/> - <Caret Line="896" Column="49" TopLine="872"/> + <Caret Line="528" Column="13" TopLine="501"/> </Position18> <Position19> <Filename Value="raetselunit.pas"/> - <Caret Line="900" Column="51" TopLine="872"/> + <Caret Line="560" Column="11" TopLine="534"/> </Position19> <Position20> - <Filename Value="raetselunit.inc"/> - <Caret Line="392" Column="27" TopLine="373"/> + <Filename Value="raetselunit.pas"/> + <Caret Line="569" Column="11" TopLine="542"/> </Position20> <Position21> - <Filename Value="raetselunit.inc"/> + <Filename Value="raetselunit.pas"/> + <Caret Line="689" Column="11" TopLine="662"/> </Position21> <Position22> - <Filename Value="raetselunit.inc"/> - <Caret Line="16" Column="36"/> + <Filename Value="raetselunit.pas"/> + <Caret Line="783" Column="48" TopLine="763"/> </Position22> <Position23> - <Filename Value="raetselunit.inc"/> - <Caret Line="283" Column="23" TopLine="249"/> + <Filename Value="raetselunit.pas"/> </Position23> <Position24> - <Filename Value="raetselunit.inc"/> - <Caret Line="279" Column="42" TopLine="259"/> + <Filename Value="raetselunit.pas"/> + <Caret Line="76" Column="23" TopLine="49"/> </Position24> <Position25> - <Filename Value="raetselunit.inc"/> - <Caret Line="277" TopLine="260"/> + <Filename Value="raetselunit.pas"/> + <Caret Line="116" Column="23" TopLine="89"/> </Position25> <Position26> <Filename Value="raetselunit.pas"/> - <Caret Line="633" Column="3" TopLine="611"/> + <Caret Line="351" Column="11" TopLine="324"/> </Position26> <Position27> <Filename Value="raetselunit.pas"/> - <Caret Line="628" Column="35" TopLine="613"/> + <Caret Line="381" Column="13" TopLine="354"/> </Position27> <Position28> <Filename Value="raetselunit.pas"/> - <Caret Line="620" TopLine="599"/> + <Caret Line="393" Column="9" TopLine="365"/> </Position28> <Position29> <Filename Value="raetselunit.pas"/> - <Caret Line="645" Column="3" TopLine="624"/> + <Caret Line="39" Column="7" TopLine="22"/> </Position29> <Position30> <Filename Value="raetselunit.pas"/> - <Caret Line="640" Column="36" TopLine="625"/> + <Caret Line="401" Column="14" TopLine="376"/> </Position30> </JumpHistory> <RunParams> diff --git a/raetselunit.pas b/raetselunit.pas index 6898c6c..b61358d 100644 --- a/raetselunit.pas +++ b/raetselunit.pas @@ -39,7 +39,8 @@ type zeichenFlaeche: tImage; erzeugeBtn, speichernBtn, - ladenBtn: tButtonWithArrowKeys; + ladenBtn, + druckenBtn: tButtonWithArrowKeys; zufallSE: tSpinEdit; progressBar1: tProgressBar; aktuelleFarbe: tColor; @@ -54,6 +55,7 @@ type procedure erzeugeOnClick(sender: tObject); procedure speichernOnClick(sender: tObject); procedure ladenOnClick(sender: tObject); + procedure druckenOnClick(sender: tObject); procedure farbWahlFlaecheBemalen; procedure loeschen; dynamic; abstract; procedure leeren; dynamic; abstract; @@ -70,7 +72,7 @@ type onSetCaption: tOnSetCaption; constructor create(aOwner: tForm); destructor destroy; override; - procedure zeichnen; dynamic; abstract; + procedure zeichnen(cursor: boolean = true); dynamic; abstract; end; tFelderRaetsel = class(tRaetsel) @@ -106,7 +108,7 @@ type public constructor create(aOwner: tForm; anzInhTypen: longint; alphabetFunktion: tAlphabetFunktion); destructor destroy; override; - procedure zeichnen; override; + procedure zeichnen(cursor: boolean = true); override; end; {$DEFINE interface} @@ -130,7 +132,7 @@ const implementation uses - math, dialogs, lclintf; + math, dialogs, lclintf, extDlgs; {$DEFINE alphabetFunktion} function zahlenAlphabetFunktion(i: longint): string; @@ -232,6 +234,13 @@ begin ladenBtn.caption:='Laden!'; ladenBtn.onClick:=@ladenOnClick; ladenBtn.onKeyDown:=@onKeyDown; + druckenBtn:=tButtonWithArrowKeys.create(besitzer); + druckenBtn.parent:=besitzer; + druckenBtn.left:=ladenBtn.left+ladenBtn.width+spacing; + druckenBtn.top:=spacing; + druckenBtn.caption:='Drucken!'; + druckenBtn.onClick:=@druckenOnClick; + druckenBtn.onKeyDown:=@onKeyDown; zufallSE:=tSpinEdit.create(besitzer); zufallSE.parent:=besitzer; zufallSE.top:=erzeugeBtn.top+erzeugeBtn.height+spacing; @@ -265,7 +274,7 @@ begin result:= max( zeichenFlaeche.width+zeichenFlaeche.left, - ladenBtn.width+ladenBtn.left + druckenBtn.width+druckenBtn.left )+spacing; end; @@ -368,6 +377,26 @@ begin openDialog1.free; end; +procedure tRaetsel.druckenOnClick(sender: tObject); +var + safePictureDialog1: tSavePictureDialog; + img: tImage; +begin + safePictureDialog1:=TSavePictureDialog.create(besitzer); + if safePictureDialog1.execute then begin + img:=zeichenFlaeche; + zeichenFlaeche:=tImage.create(img.parent); + zeichenFlaeche.width:=img.width; + zeichenFlaeche.height:=img.height; + zeichnen(false); + zeichenFlaeche.picture.saveToFile(safePictureDialog1.fileName); + zeichenFlaeche.free; + zeichenFlaeche:=img; + img:=nil; + end; + safePictureDialog1.free; +end; + procedure tRaetsel.farbWahlFlaecheBemalen; var i: integer; @@ -676,7 +705,7 @@ begin end; end; -procedure tFelderRaetsel.zeichnen; +procedure tFelderRaetsel.zeichnen(cursor: boolean = true); var i: longint; begin @@ -712,7 +741,7 @@ begin end; zeichenFlaeche.canvas.pen.width:=3; zeichenFlaeche.canvas.pen.color:=$8080ff; - if (cursorPosition>=0) and (dim>0) then begin + if (cursorPosition>=0) and (dim>0) and cursor then begin zeichenFlaeche.canvas.brush.color:= $ffffff - $181818 * byte( diagonalenCB.checked and ( @@ -1,12 +1,12 @@ object Form1: TForm1 - Left = 740 + Left = 719 Height = 313 - Top = 407 + Top = 449 Width = 426 BorderStyle = bsSingle Caption = 'Rätsel' OnCreate = FormCreate OnDestroy = FormDestroy OnShow = FormShow - LCLVersion = '1.8.4.0' + LCLVersion = '2.0.6.0' end |