StatusBar1 komponentasini obyektlar inspektori oynasidandan SizeGrip xususiyatini false ga o`zgartiramiz.
StatusBar1 komponentasini obyektlar inspektori oynasidandan Tag xususiyatini 0 ga o`zgartiramiz.
StatusBar1 komponentasini obyektlar inspektori oynasidandan UseSystemFont xususiyatini true ga o`zgartiramiz.
StatusBar1 komponentasini obyektlar inspektori oynasidandan Visible xususiyatini true ga o`zgartiramiz.
“Daftarcha” dasturining kodlari.
Umumiy kod: Unit1.cpp faylining kodlari:
//---------------------------------------------------------------------------
#include
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "sSkinManager"
#pragma resource "*.dfm"
TForm1 *Form1;
AnsiString faylnomi;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Saqlash1Click(TObject *Sender)
{
if (faylnomi!="")
{
Memo1->Lines->SaveToFile(faylnomi);
Memo1->Modified=false;
}
else
{
Saqlashyanginombn1->Click();
}
//SaveDialog1->Execute();
//Memo1->Lines->SaveToFile(SaveDialog1->FileName);
//Form1->Caption=SaveDialog1->FileName;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Ochish1Click(TObject *Sender)
{
OpenDialog1->Execute();
Memo1->Lines->LoadFromFile(OpenDialog1->FileName);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Yangi1Click(TObject *Sender)
{
if (Memo1->Modified)
{
//TMsgDlgButtons op;
//op<
switch (MessageDlg("Ma'lumotlar o`zgargan. Saqlaysizmi?",mtConfirmation, mbYesNoCancel,0))
{
case mrYes:Saqlash1->Click();Memo1->Clear();break;
case mrNo:Memo1->Clear();break;
}
}
Memo1->Clear();
Form1->Caption="Yangi hujjat";
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Chiqish1Click(TObject *Sender)
{
if (Memo1->Modified)
{
//TMsgDlgButtons op;
//op<
switch (MessageDlg("Ma'lumotlar o`zgargan. Saqlaysizmi?",mtConfirmation, mbYesNoCancel,0))
{
case mrYes:Saqlash1->Click();Memo1->Clear();break;
case mrNo:Close();break;
//case mrCancel:Form1->Click();break;
}
Close();
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Kesish1Click(TObject *Sender)
{
Memo1->CutToClipboard();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Kochirish1Click(TObject *Sender)
{
Memo1->CopyToClipboard();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Nusxaolish1Click(TObject *Sender)
{
Memo1->CopyToClipboard();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Qoyish1Click(TObject *Sender)
{
Memo1->PasteFromClipboard();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Format1Click(TObject *Sender)
{
FontDialog1->Execute();
Memo1->Font=FontDialog1->Font;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Saqlashyanginombn1Click(TObject *Sender)
{
SaveDialog1->Execute();
Memo1->Lines->SaveToFile(SaveDialog1->FileName);
Form1->Caption=SaveDialog1->FileName;
faylnomi=SaveDialog1->FileName;
Memo1->Modified=false;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Xabar1Click(TObject *Sender)
{
switch (MessageDlg("Ma'lumotlar o`zgargan. Saqlaysizmi?",mtConfirmation, mbYesNoCancel,0))
{
case mrYes:ShowMessage("Ha");break;
case mrNo:ShowMessage("Yo`q");Close();break;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Qidiruv1Click(TObject *Sender)
{
FindDialog1->Execute();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FindDialog1Find(TObject *Sender)
{
AnsiString qid=FindDialog1->FindTextA;
int k=Memo1->Text.Pos(qid);
if (k>0)
{
Memo1->SelStart=k-1;
Memo1->SelLength=qid.Length();
Memo1->SetFocus();
}
else
{
ShowMessage("Qidirilayotgan matn mavjud emas!");
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Memo1KeyPress(TObject *Sender, char &Key)
{
int qator=Memo1->Lines->Count;
int simvol=Memo1->Text.Length();
StatusBar1->SimpleText=IntToStr(qator)+" ta qator "+IntToStr(simvol)+" ta belgi";
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Ozbekcha1Click(TObject *Sender)
{
Form1->Menu=MainMenu1;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Ruscha1Click(TObject *Sender)
{
Form1->Menu=MainMenu2;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Memo1Change(TObject *Sender)
{
}
//---------------------------------------------------------------------------
Unit1.h faylidagi kodlari:
//---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include
#include
#include
#include
#include
#include
#include
#include "sSkinManager.hpp"
#include
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TMainMenu *MainMenu1;
TMemo *Memo1;
TMenuItem *Fayl1;
TMenuItem *Yangi1;
TMenuItem *Ochish1;
TMenuItem *Yopish1;
TMenuItem *N1;
TMenuItem *Saqlash1;
TMenuItem *Saqlashyanginombn1;
TMenuItem *Chiqish1;
TMenuItem *Ozgartirish1;
TMenuItem *Kesish1;
TMenuItem *Kochirish1;
TMenuItem *Nusxaolish1;
TMenuItem *Qoyish1;
TImageList *ImageList1;
TMenuItem *Format1;
TOpenDialog *OpenDialog1;
TSaveDialog *SaveDialog1;
TFontDialog *FontDialog1;
TPopupMenu *PopupMenu1;
TMenuItem *Kesish2;
TMenuItem *Kochirish2;
TMenuItem *Nusxaolish2;
TMenuItem *Qoyish2;
TMenuItem *Xabar1;
TsSkinManager *sSkinManager1;
TMenuItem *Qidiruv1;
TFindDialog *FindDialog1;
TStatusBar *StatusBar1;
TMainMenu *MainMenu2;
TMenuItem *N2;
TMenuItem *N3;
TMenuItem *N4;
TMenuItem *N5;
TMenuItem *N6;
TMenuItem *N7;
TMenuItem *N8;
TMenuItem *N9;
TMenuItem *N10;
TMenuItem *Dasturtili1;
TMenuItem *Ozbekcha1;
TMenuItem *Ruscha1;
TMenuItem *Inglizcha1;
TMenuItem *N11;
TMenuItem *N12;
TMenuItem *N13;
TMenuItem *N14;
void __fastcall Saqlash1Click(TObject *Sender);
void __fastcall Ochish1Click(TObject *Sender);
void __fastcall Yangi1Click(TObject *Sender);
void __fastcall Chiqish1Click(TObject *Sender);
void __fastcall Kesish1Click(TObject *Sender);
void __fastcall Kochirish1Click(TObject *Sender);
void __fastcall Nusxaolish1Click(TObject *Sender);
void __fastcall Qoyish1Click(TObject *Sender);
void __fastcall Format1Click(TObject *Sender);
void __fastcall Saqlashyanginombn1Click(TObject *Sender);
void __fastcall Xabar1Click(TObject *Sender);
void __fastcall Qidiruv1Click(TObject *Sender);
void __fastcall FindDialog1Find(TObject *Sender);
void __fastcall Memo1KeyPress(TObject *Sender, char &Key);
void __fastcall Ozbekcha1Click(TObject *Sender);
void __fastcall Ruscha1Click(TObject *Sender);
void __fastcall Memo1Change(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
“Daftarcha” dasturidagi tugmalarning kodlari:
Yangi deb nomlangan tugmaning kodi
void __fastcall TForm1::Yangi1Click(TObject *Sender)
{
if (Memo1->Modified)
{
//TMsgDlgButtons op;
//op<
switch (MessageDlg("Ma'lumotlar o`zgargan. Saqlaysizmi?",mtConfirmation, mbYesNoCancel,0))
{
case mrYes:Saqlash1->Click();Memo1->Clear();break;
case mrNo:Memo1->Clear();break;
}
}
Memo1->Clear();
Form1->Caption="Yangi hujjat";
}
//---------------------------------------------------------------------------
Ochish deb nomlangan tugmaning kodi
void __fastcall TForm1::Ochish1Click(TObject *Sender)
{
OpenDialog1->Execute();
Memo1->Lines->LoadFromFile(OpenDialog1->FileName);
}
//---------------------------------------------------------------------------
Yopish deb nomlangan tugmaning kodi
void __fastcall TForm1::Yopish1Click(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------
Do'stlaringiz bilan baham: |