From c4f944b58c30dcc8ca2ac6f3388029d6b8eef5a2 Mon Sep 17 00:00:00 2001 From: Aleksander Misztal Date: Sat, 9 Feb 2019 02:44:36 +0000 Subject: [PATCH] =?UTF-8?q?Prze=C5=9Blij=20pliki=20do=20''?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Project1.obj | Bin 0 -> 18784 bytes Project1.res | Bin 0 -> 1356 bytes Unit1.~cpp | 181 +++++++++++++++++++++++++++++++++++++++++++++++++++ Unit1.~dfm | 139 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 320 insertions(+) create mode 100644 Project1.obj create mode 100644 Project1.res create mode 100644 Unit1.~cpp create mode 100644 Unit1.~dfm diff --git a/Project1.obj b/Project1.obj new file mode 100644 index 0000000000000000000000000000000000000000..76d08bb61268adc61e027906b1f5f957933c15f7 GIT binary patch literal 18784 zcmb_k3t$|_S)P;bC0UYX`TdqHMe!?&WjnItB+bc^Y%8^F$2y%Is&;d_TS;r}-K}r; zB)M&Zi%XEJ21+3%l$xrb0wq92d6n?!kp{velr$6)AV47sq%>)Hq-~nGG2j2s?%tiP zJans-zulRC{`u#hfBu=Botg86RPT^%(Cx>R%2$`}L3GgjP6Yoh}v zvzfDM!fI1Z!E`(TmD3jIW>11Q)&Yg|7w6=@MTZDLVVUnf;J;%jlj}YGwM#rv> z#K8e0n;Fi=Q;kEKu9}V8CJwZ39~hJc4I~D0nx0g%?E_jmq34q7z*s^b=$^1Tt*mag zj*w=DY*_~vEGv;orIPw^>xh^~RbRJTrBt=kr?*0`27 zjZ8+T%6Zf1w3hCZlDyaMWL8UC@HuIz@@r>~sJb3EH1DeCuQe&uU5b#fWX40}HlJ zCT@!;zr$yAHJ-CF-p$gHu(UDtjBF-v4c?#Cdo$_9kkmJ#pBOwVC3zdqy0o~S8Mb@r zU3QBdT5yYzKOa?fqbF?**}@Ln!roPuu)~>b%JbNf%ITJtB9nU^8GA{R+j!op)~lv- zcGbFU8{J-(je1f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b_ji@@T=^HR-xcp+U20V Ojv;=YrTY|l%l`w@i=OHL literal 0 HcmV?d00001 diff --git a/Project1.res b/Project1.res new file mode 100644 index 0000000000000000000000000000000000000000..cbd8a30164d8f42d713e9aab0c2100b1984466d3 GIT binary patch literal 1356 zcmchXy-EW?5XUDZwWQGAGNoW?z!MKa@aqvQLMl6h8^{$YE%G)N7Ft}fxB=%OtgIIC z4bK0}+{L{pq|1=q+564Me|NbY5z#(IRoTF@Wy@X@?;@w8v3`FK)NBAJ;|8NchWEP` z`#aBx@T2+M9A+#r=2Vs?0%g5RGC_AN=Umm+Rv3l7igd0;N-#~hxD z1&giv64$Wv&R0{n;pG+Qy%a zGnQx!1!_&hn0M03#rvU$hOnl+2B2}|Qf3fXw(^nxvQu8=~ z)@%t$snt$3ll6*~R$DWDs3+aU=WU8;tk!0&g#RBZF@!ezZ#vez4ZbAHTk|MYo_hN# z$p7DLJHGoNI#s#R+r5 +#pragma hdrstop + +#include "Unit1.h" +#include "Unit2.h" +#include "Unit3.h" +//--------------------------------------------------------------------------- +#pragma package(smart_init) +#pragma resource "*.dfm" +TForm1 *Form1; +AnsiString nazwapliku=""; +//--------------------------------------------------------------------------- +__fastcall TForm1::TForm1(TComponent* Owner) + : TForm(Owner) +{ +} +//--------------------------------------------------------------------------- + + +void __fastcall TForm1::Otwrz2Click(TObject *Sender) +{ + if (OpenDialog1->Execute()){ + + try{ + tresc->Lines->LoadFromFile(OpenDialog1->FileName); + nazwapliku = OpenDialog1->FileName; + } + catch (...){ + ShowMessage("Błąd otwarcia pliku. Upewnij się, że plik istnieje na dysku"); + + } + } +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::Zapisz1Click(TObject *Sender) +{ + if (nazwapliku!=""){ + tresc->Lines->SaveToFile(nazwapliku); + } + else{ + Form1->Zapiszjako1Click(MainMenu1); + + } +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::Zapiszjako1Click(TObject *Sender) +{ + if (SaveDialog1->Execute()){ + + try{ + tresc->Lines->SaveToFile(SaveDialog1->FileName); + nazwapliku = SaveDialog1->FileName; + } + catch (...){ + ShowMessage("Zapis zakończył się niepowodzeniem."); + } + } +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::Nowy1Click(TObject *Sender) +{ + if(Application->MessageBox("Czy na pewno utworzyć nowy plik ?","Potwierdź", + MB_YESNOCANCEL | MB_ICONQUESTION) == IDYES ){ + tresc->Lines->Clear(); + nazwapliku=""; + } +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::trescKeyDown(TObject *Sender, WORD &Key, + TShiftState Shift) +{ + if (Shift.Contains(ssCtrl)) + { + if((Key == 's') || (Key =='S')){ + Form1->Zapisz1Click(MainMenu1); + } + } + if (Shift.Contains(ssCtrl)) + { + if((Key == 'n') || (Key =='N')){ + Form1->Otwrz2Click(MainMenu1); + } + } +} + +//--------------------------------------------------------------------------- +void __fastcall TForm1::Zakocz1Click(TObject *Sender) +{ + if(Application->MessageBox("Czy na pewno zakończyć program ?","Potwierdź", + MB_YESNO | MB_ICONQUESTION) == IDYES ){ + Application->Terminate(); + } + + +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action) +{ + if(Application->MessageBox("Czy na pewno zakończyć program ?","Potwierdź", + MB_YESNO | MB_ICONQUESTION) == IDNO ){ + Action=caNone; + } +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::Wytnijcrtx1Click(TObject *Sender) +{ + tresc->CutToClipboard(); +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::Kopiiuj1Click(TObject *Sender) +{ + tresc->CopyToClipboard(); +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::WklejCtrlV1Click(TObject *Sender) +{ + tresc->PasteFromClipboard(); +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::Zawijaniewierszy1Click(TObject *Sender) +{ + + if(Zawijaniewierszy1->Checked==true) + { + Zawijaniewierszy1->Checked=false; + tresc->WordWrap=false; + tresc->ScrollBars = ssBoth; + + } + else + { + Zawijaniewierszy1->Checked=true; + tresc->WordWrap=true; + tresc->ScrollBars = ssVertical; + + } + + + + + +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::Ccionka1Click(TObject *Sender) +{ + if(FontDialog1->Execute()) + { + tresc->Font->Name = FontDialog1->Font->Name; + + tresc->Font->Color = FontDialog1->Font->Color; + + tresc->Font->Size = FontDialog1->Font->Size; + + tresc->Font->Style = FontDialog1->Font->Style; + } +} +//--------------------------------------------------------------------------- + + +void __fastcall TForm1::Oprogramie1Click(TObject *Sender) +{ + Form2->ShowModal(); +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::WujekGoogle1Click(TObject *Sender) +{ + ShellExecute(NULL,"open","https://www.google.pl", NULL, NULL, SW_SHOWNORMAL); +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::Kalkulator1Click(TObject *Sender) +{ + Form3->ShowModal(); +} +//--------------------------------------------------------------------------- + diff --git a/Unit1.~dfm b/Unit1.~dfm new file mode 100644 index 0000000..3baede1 --- /dev/null +++ b/Unit1.~dfm @@ -0,0 +1,139 @@ +object Form1: TForm1 + Left = 1320 + Top = 282 + Width = 1305 + Height = 675 + Caption = 'M'#243'j notatnik' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Style = [] + Menu = MainMenu1 + OldCreateOrder = False + OnClose = FormClose + PixelsPerInch = 120 + TextHeight = 16 + object tresc: TMemo + Left = 0 + Top = 0 + Width = 1287 + Height = 605 + Align = alClient + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -23 + Font.Name = 'MS Sans Serif' + Font.Style = [] + Lines.Strings = ( + '') + ParentFont = False + ScrollBars = ssVertical + TabOrder = 0 + OnKeyDown = trescKeyDown + end + object MainMenu1: TMainMenu + Left = 424 + Top = 104 + object Plik1: TMenuItem + Caption = '&Plik' + object Nowy1: TMenuItem + Caption = '&Nowy Ctrl+N' + OnClick = Nowy1Click + end + object Otwrz1: TMenuItem + Caption = '-' + end + object Otwrz2: TMenuItem + Caption = '&Otw'#243'rz Ctrl+O' + OnClick = Otwrz2Click + end + object Zapisz1: TMenuItem + Caption = 'Za&pisz Ctrl+S' + OnClick = Zapisz1Click + end + object Zapiszjako1: TMenuItem + Caption = 'Zapi&sz jako' + OnClick = Zapiszjako1Click + end + object N1: TMenuItem + Caption = '-' + end + object Zakocz1: TMenuItem + Caption = 'Zako&'#324'cz' + OnClick = Zakocz1Click + end + end + object Edycja1: TMenuItem + Caption = '&Edycja' + object Wytnijcrtx1: TMenuItem + Caption = 'W&ytnij Ctrt+X' + OnClick = Wytnijcrtx1Click + end + object Kopiiuj1: TMenuItem + Caption = 'Kop&iuj Ctrl+C ' + OnClick = Kopiiuj1Click + end + object WklejCtrlV1: TMenuItem + Caption = 'Wkl&ej Ctrl+V' + OnClick = WklejCtrlV1Click + end + end + object Format1: TMenuItem + Caption = '&Format' + object Zawijaniewierszy1: TMenuItem + Caption = 'Z&awijanie wierszy' + Checked = True + OnClick = Zawijaniewierszy1Click + end + object Ccionka1: TMenuItem + Caption = 'C&zcionka' + OnClick = Ccionka1Click + end + end + object Pomoc1: TMenuItem + Caption = '&Pomoc' + object Informacje1: TMenuItem + Caption = 'In&formacje' + object Oprogramie1: TMenuItem + Caption = 'O &programie' + OnClick = Oprogramie1Click + end + end + object WujekGoogle1: TMenuItem + Caption = 'W&ujek Google' + OnClick = WujekGoogle1Click + end + end + object Kalkulator1: TMenuItem + Caption = '&Kalkulator' + OnClick = Kalkulator1Click + end + object Zegar1: TMenuItem + Caption = ' ' + end + end + object OpenDialog1: TOpenDialog + Filter = 'Pliki tekstowe (txt)|*.txt|Wszystkie pliki|*.*' + Left = 368 + Top = 112 + end + object SaveDialog1: TSaveDialog + Filter = 'Plik tekstowy (txt)|*txt|Wszystkie pliki|*.*' + Options = [ofOverwritePrompt, ofHideReadOnly, ofEnableSizing] + Left = 320 + Top = 120 + end + object FontDialog1: TFontDialog + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Style = [] + MinFontSize = 0 + MaxFontSize = 0 + Left = 264 + Top = 120 + end +end