Programlama | Programlama Dilleri | C Programlama Dili |C++

Anasayfa Programlama C++ Builder Not Defteri Program?


Not Defteri Program?

AÇIKLAMA

Bu proje ile birlikte not defteri uygulamas? geli?tirilmeye çal???lm??t?r. Bu program ile birlikte not defteri benzeri programlar?n yap?lmas? konusunda örnek te?kil eder.

Program?n Tamam?n? A?a??daki Linkten ?ndirebilirsiniz

Linki Görebilmeniz ?çin Üye Olman?z Gerekmektedir...

Üye Kay?t

Program Kodu:

  1. //---------------------------------------------------------------------------
  2.  
  3. #include <vcl.h>
  4. #pragma hdrstop
  5.  
  6. #include "Unit1.h"
  7. #include "Unit2.h"
  8. //---------------------------------------------------------------------------
  9. #pragma package(smart_init)
  10. #pragma resource "*.dfm"
  11. TForm1 *Form1;
  12. //---------------------------------------------------------------------------
  13. __fastcall TForm1::TForm1(TComponent* Owner)
  14.         : TForm(Owner)
  15. {
  16. }
  17. //---------------------------------------------------------------------------
  18.  
  19. void __fastcall TForm1::YeniCtrlN1Click(TObject *Sender)
  20. {
  21. if(RichEdit1->Modified)
  22. {
  23. int a=Application->MessageBox("De?i?iklik Var Kay?t Etmek ?ster misiniz?", "Uyar?",MB_ICONINFORMATION+MB_YESNOCANCEL);
  24.   switch(a)
  25.   {
  26.      case IDYES: KaydetCtrlS1->Click(); RichEdit1->Lines->Clear(); Caption="Hat?ra Defteri"; break;
  27.      case IDNO:  RichEdit1->Lines->Clear(); Caption="Hat?ra Defteri"; break;
  28.      case IDCANCEL: break;
  29.   }
  30. }
  31. }
  32. //---------------------------------------------------------------------------
  33. void __fastcall TForm1::KaydetCtrlS1Click(TObject *Sender)
  34. {   if(RichEdit1->Modified)
  35. {
  36. if(Caption=="Hat?ra Defteri")
  37. {
  38. FarklKaydet1->Click();
  39.  
  40. }
  41. else
  42. {
  43.    RichEdit1->Lines->SaveToFile(Caption);
  44. }}
  45. else
  46. Application->MessageBox("Dosyan?zda Bir De?i?iklik Olmam??t?r","Uyar?",MB_ICONINFORMATION) ;
  47. }
  48. //---------------------------------------------------------------------------
  49. void __fastcall TForm1::ACtrlO1Click(TObject *Sender)
  50. {
  51. if(RichEdit1->Modified)
  52.  
  53.         YeniCtrlN1->Click();
  54.   if(OpenDialog1->Execute())
  55.      {
  56.        RichEdit1->Lines->LoadFromFile(OpenDialog1->FileName);
  57.        Caption=OpenDialog1->FileName;
  58.      }
  59. }
  60. //---------------------------------------------------------------------------
  61. void __fastcall TForm1::FormCreate(TObject *Sender)
  62. {
  63.  
  64. int yer=0,adet=0;
  65. RichEdit1->HideSelection=false;
  66. SaveDialog1->DefaultExt="htr";
  67.  OpenDialog1->DefaultExt="htr";
  68. OpenDialog1->Filter="Hat?ra Dosyalar? (*.htr) |*.htr| Bütün Dosyalar (*.*) |*.*";
  69.  SaveDialog1->Filter="Hat?ra Dosyalar? (*.htr) |*.htr| Bütün Dosyalar (*.*) |*.*";
  70.  
  71. }
  72. //---------------------------------------------------------------------------
  73. void __fastcall TForm1::FarklKaydet1Click(TObject *Sender)
  74. {
  75. if(SaveDialog1->Execute())
  76.   {
  77.   RichEdit1->Lines->SaveToFile(SaveDialog1->FileName);
  78.   Caption=SaveDialog1->FileName;
  79.   }
  80. }
  81. //---------------------------------------------------------------------------
  82. void __fastcall TForm1::YazdrCtrlP1Click(TObject *Sender)
  83. {
  84. PrintDialog1->Execute();
  85. }
  86. //---------------------------------------------------------------------------
  87. void __fastcall TForm1::k1Click(TObject *Sender)
  88. {
  89. if(RichEdit1->Lines->Count>0)
  90. {
  91.        YeniCtrlN1->Click();
  92.        Form1->Close();
  93. }
  94. }
  95. //---------------------------------------------------------------------------
  96. void __fastcall TForm1::TmnSeCtrlA1Click(TObject *Sender)
  97. {
  98. RichEdit1->SelectAll();
  99. }
  100. //---------------------------------------------------------------------------
  101. void __fastcall TForm1::TarihSaat1Click(TObject *Sender)
  102. {
  103. RichEdit1->Text=TimeToStr(Time()) +"   "+ DateToStr(Date());
  104. }
  105. //---------------------------------------------------------------------------
  106. void __fastcall TForm1::KesCtrlX1Click(TObject *Sender)
  107. {
  108. RichEdit1->CutToClipboard();
  109. YaptrCtrlV1->Enabled=true;
  110.  
  111. }
  112. //---------------------------------------------------------------------------
  113. void __fastcall TForm1::KopyalaCtrlC1Click(TObject *Sender)
  114. {
  115. RichEdit1->CopyToClipboard();
  116. YaptrCtrlV1->Enabled=true;
  117. }
  118. //---------------------------------------------------------------------------
  119. void __fastcall TForm1::YaptrCtrlV1Click(TObject *Sender)
  120. {
  121. RichEdit1->PasteFromClipboard();
  122. }
  123. //---------------------------------------------------------------------------
  124. void __fastcall TForm1::SilDel1Click(TObject *Sender)
  125. {
  126. RichEdit1->ClearSelection();
  127. }
  128. //---------------------------------------------------------------------------
  129. void __fastcall TForm1::RenkSeimi1Click(TObject *Sender)
  130. {    if(ColorDialog1->Execute())
  131. RichEdit1->Font->Color=ColorDialog1->Color;
  132. }
  133. //---------------------------------------------------------------------------
  134. void __fastcall TForm1::YazTipi1Click(TObject *Sender)
  135. {
  136. if(FontDialog1->Execute())
  137.   RichEdit1->Font=FontDialog1->Font;       
  138. }
  139. //---------------------------------------------------------------------------
  140. void __fastcall TForm1::Dzen1Click(TObject *Sender)
  141. {
  142. if(RichEdit1->Lines->Count==0)
  143. {
  144.   BulCtrlF1->Enabled=false;
  145.   SonrakiniBulCtrl1->Enabled=false;
  146.   DeitirCtrlH1->Enabled=false;
  147. }
  148. else
  149. {
  150.   BulCtrlF1->Enabled=true;
  151.   DeitirCtrlH1->Enabled=true;
  152.   SonrakiniBulCtrl1->Enabled=true;
  153. }
  154. if(RichEdit1->SelText=="")
  155. {
  156. KopyalaCtrlC1->Enabled=false;
  157. KesCtrlX1->Enabled=false;
  158. SilDel1->Enabled=false;
  159. YaptrCtrlV1->Enabled=true;
  160. }
  161. else
  162. {
  163. KopyalaCtrlC1->Enabled=true;
  164. KesCtrlX1->Enabled=true;
  165. SilDel1->Enabled=true;
  166. }
  167. }
  168. //---------------------------------------------------------------------------
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175. void __fastcall TForm1::FindDialog1Find(TObject *Sender)
  176. {
  177.  
  178. static yer=0,adet=0;
  179. AnsiString s,f;
  180. int b;
  181. f=FindDialog1->FindText;
  182. s=RichEdit1->Text.SubString(yer+1,RichEdit1->Text.Length()-yer+1);
  183. if (!FindDialog1->Options.Contains(frMatchCase) )
  184. {
  185. f=f.UpperCase();
  186. s.UpperCase();
  187. }
  188. b=s.Pos(f);
  189. yer=yer+b;
  190. if (b==0)
  191. if (adet==0)
  192.   ShowMessage(f+"Bulunamad?");
  193.   else
  194.   {
  195.   ShowMessage("Arama Tamamland?");
  196.   FindDialog1->CloseDialog();
  197.   adet=0;
  198.   yer=0;
  199.   }
  200.   else
  201.   {
  202.   RichEdit1->SelStart=yer-1;
  203.   RichEdit1->SelLength=f.Length();
  204.  
  205.   }
  206.   adet++;
  207. }
  208. //---------------------------------------------------------------------------
  209.  
  210. void __fastcall TForm1::BulCtrlF1Click(TObject *Sender)
  211. {
  212. FindDialog1->Options=FindDialog1->Options<<frHideUpDown<<
  213. frHideWholeWord;
  214. FindDialog1->FindText=RichEdit1->SelText;
  215. FindDialog1->Execute();
  216. }
  217. //---------------------------------------------------------------------------
  218.  
  219. void __fastcall TForm1::SonrakiniBulCtrl1Click(TObject *Sender)
  220. {
  221. FindDialog1->Options=FindDialog1->Options<<frHideUpDown<<
  222. frHideWholeWord;
  223. FindDialog1->FindText=RichEdit1->SelText;
  224. FindDialog1->Execute();       
  225. }
  226. //---------------------------------------------------------------------------
  227.  
  228. void __fastcall TForm1::DeitirCtrlH1Click(TObject *Sender)
  229. {
  230. ReplaceDialog1->Options=ReplaceDialog1->Options<<frHideUpDown<<
  231. frHideWholeWord;
  232. ReplaceDialog1->FindText=RichEdit1->SelText;
  233. ReplaceDialog1->Execute();
  234. }
  235. //---------------------------------------------------------------------------
  236.  
  237. void __fastcall TForm1::ReplaceDialog1Find(TObject *Sender)
  238. {
  239. AnsiString s,f;
  240. int b,yer,adet;
  241. f=ReplaceDialog1->FindText;
  242. s=RichEdit1->Text.SubString(yer+1,RichEdit1->Text.Length()-yer+1);
  243. if(!ReplaceDialog1->Options.Contains(frMatchCase))
  244. {
  245. f=f.UpperCase();
  246. s=s.UpperCase();
  247. }
  248. b=s.Pos(f);
  249. yer=yer+b;
  250. if(b==0)
  251. if (adet==0)
  252. ShowMessage(f+"Bulunamad?");
  253.   else
  254.   {
  255.   ShowMessage("Arama Tamamland?");
  256.   FindDialog1->CloseDialog();
  257.   adet=0;
  258.   yer=0;
  259.   }
  260.   else
  261.   {
  262.   RichEdit1->SelStart=yer-1;
  263.   RichEdit1->SelLength=f.Length();
  264.  
  265.   }
  266.   adet++;
  267.  
  268. }
  269. //---------------------------------------------------------------------------
  270.  
  271. void __fastcall TForm1::ReplaceDialog1Replace(TObject *Sender)
  272. {
  273. AnsiString s,f,r,sec;
  274. int b,yer,adet;
  275. bool d;
  276. f=ReplaceDialog1->FindText;
  277. r=ReplaceDialog1->ReplaceText;
  278. s=RichEdit1->Text.SubString(yer+1,RichEdit1->Text.Length()-yer+1);
  279. if(!ReplaceDialog1->Options.Contains(frMatchCase))
  280. {
  281. f=f.UpperCase();
  282. s=s.UpperCase();
  283. d=(stricmp(RichEdit1->SelText.c_str(),f.c_str())==0);
  284. }
  285. else
  286. d=(RichEdit1->SelText==f);
  287. if(ReplaceDialog1->Options.Contains(frReplace))
  288. {
  289. if(d)
  290. {
  291. RichEdit1->SelText=r;
  292. yer=yer+r.Length()-1;
  293. s=RichEdit1->Text.SubString(yer+1,RichEdit1->Text.Length()-yer+1);
  294. if(!ReplaceDialog1->Options.Contains(frMatchCase))
  295. s=s.UpperCase();
  296. }
  297. b=s.Pos(f);
  298. yer+=b;
  299. if(b==0)
  300. {
  301. if (adet==0)
  302. ShowMessage(f+"Bulunamad?");
  303. else
  304. ShowMessage("De?i?tirme Tamamland?");
  305. ReplaceDialog1->CloseDialog();
  306. adet=0;
  307. yer=0;
  308. }
  309. else
  310. {
  311. RichEdit1->SelStart=yer-1;
  312. RichEdit1->SelLength=f.Length();
  313. }
  314. adet++;
  315. }
  316. else
  317. {
  318. b=s.Pos(f);
  319. yer+=b;
  320. while(b!=0)
  321. {
  322. adet++;
  323. RichEdit1->SelStart=yer-1;
  324. RichEdit1->SelLength=f.Length();
  325. RichEdit1->SelText=r;
  326. yer+=r.Length()-1;
  327. s=RichEdit1->Text.SubString(yer+1,RichEdit1->Text.Length()-yer+1);
  328. if(!ReplaceDialog1->Options.Contains(frMatchCase))
  329. s=s.UpperCase();
  330. b=s.Pos(f);
  331. yer+=b;
  332. }
  333. ShowMessage(IntToStr(adet)+ "adet de?i?tirildi");
  334. ReplaceDialog1->CloseDialog();
  335. adet=0;
  336. yer=0;
  337.  }
  338.  
  339. }
  340. //---------------------------------------------------------------------------
  341.  
  342.  
  343.  
  344.  
  345. void __fastcall TForm1::GitCtrlH1Click(TObject *Sender)
  346. {
  347. int a=StrToInt(InputBox("Sat?r Giri?i","Gidilecek Sat?r? Yaz?n?z",""));
  348. RichEdit1->Lines->Insert(a,"");
  349. RichEdit1->Lines->Delete(a);
  350. }
  351. //---------------------------------------------------------------------------
  352.  
  353. void __fastcall TForm1::DefterHakknda1Click(TObject *Sender)
  354. {
  355. Form2->Show();
  356. }
  357. //---------------------------------------------------------------------------
  358.  
  359.  

Yorumlar (2)
  • metin
    Süper Bir Program Ekleyen ve yapana çok çok te?ekkürler :)
  • Melek  - Te?ekkürler arrkada?,
    [color=blue][/color][size=medium][/size] Çok te?ekkürler süper bu ... Ba?ar?lar...
Sadece kayıtlı kullanıcılar yorum yazabilir!
Son Güncelleme ( Salı, 04 Eylül 2012 03:05 )  
404 Not Found

Not Found

The requested URL was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.