빌더 2006 이상으로 가면 그룹박스의 모퉁이가 라운딩처리가 되어 있는 것을 흉내낸 것입니다.
빌더 6에서는 XP Style을 리소스에 적용해도 그룹박스 모양은 바뀌지 않는데,
이는 TGroupBox에서Theme를 써서 그리지 않기 때문에 적용이 되지 않는 것입니다.
빌더 6에서 기존 그룹박스 모양을 조금 다르게 주고 싶을 때 쓰면 됩니다.
Theme가 적용된 빌더 2006 이상과 완전히 똑같은 모양으로 만들 수도 있고 좀 더 이쁘게 만들 수도 있습니다.
Ctl3D 속성을 false로 하면 좀 더 비슷해지지요.
//---------------------------------------------------------------------------
#ifndef MainH
#define MainH
//---------------------------------------------------------------------------
#include < Classes.hpp >
#include < Controls.hpp >
#include < StdCtrls.hpp >
#include < Forms.hpp >
#include < Buttons.hpp >
#include < ComCtrls.hpp >
#include < ExtCtrls.hpp >
#include < jpeg.hpp >
//---------------------------------------------------------------------------
class TGroupBox : public Stdctrls::TGroupBox
{
protected:
void __fastcall Paint()
{
int H;
TRect R;
ULONG Flags;
TRect CaptionRect, OuterRect;
TSize Size;
TCanvas *C = Canvas;
C->Font = Font;
H = C->TextHeight("0");
R = Rect(0, H / 2 - 1, Width, Height);
if (Ctl3D)
{
R.Left++;
R.Top++;
C->Brush->Color = clBtnHighlight;
C->FrameRect(R);
OffsetRect(R, -1, -1);
C->Brush->Color = clBtnShadow;
}
else
C->Brush->Color = clWindowFrame;
//C->FrameRect(R); //org
C->Brush->Style = bsClear;
C->Pen->Color = clBtnShadow;
C->RoundRect(R.left, R.top, R.right, R.bottom, 5, 5);
if (Text != "")
{
if (!UseRightToLeftAlignment())
R = Rect(8, 0, 0, H);
else
R = Rect(R.Right - C->TextWidth(Text) - 8, 0, 0, H);
Flags = DrawTextBiDiModeFlags(DT_SINGLELINE);
DrawText(C->Handle, Text.c_str(), Text.Length(), (tagRECT *)&R, Flags | DT_CALCRECT);
C->Brush->Color = Color;
DrawText(C->Handle, Text.c_str(), Text.Length(), (tagRECT *)&R, Flags);
}
}
};
#define TGroupBox ::TGroupBox
class TFormMain : public TForm
{
__published: // IDE-managed Components
TBitBtn *BRun;
TMemo *Memo1;
TStatusBar *StatusBar1;
TPanel *Panel1;
TLabel *LFileCount;
TLabel *LLine;
TGroupBox *GroupBox1;
TCheckBox *CBCPP;
TCheckBox *CBCPPBak;
TGroupBox *GroupBox2;
TCheckBox *CBCutBlockRemark;
TCheckBox *CBCutLineMark;
TGroupBox *GroupBox3;
TEdit *EditSrcDir;
TLabel *Label1;
TEdit *EditDesDir;
TLabel *Label2;
TButton *Button1;
TButton *Button2;
TSpeedButton *SpeedButton1;
TShape *Shape1;
TImage *Image1;
TLabel *Label3;
TLabel *Label5;
TLabel *Label4;
TGroupBox *GroupBox4;
TShape *Shape2;
TLabel *Label6;
void __fastcall BRunClick(TObject *Sender);
void __fastcall FormCreate(TObject *Sender);
void __fastcall FormDestroy(TObject *Sender);
void __fastcall SpeedButton1Click(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TFormMain(TComponent* Owner);
public: // User declarations
int GetFileList(String path, TStringList *list, TOption op);
void Print(String s);
bool DoConvert(String SrcDir, String DesDir, TOption op);
void MakeTOption(TOption &op);
bool ConvertSrc(String SrcDir, String DesDir, String filename, TOption op);
bool ConvertLine(char *out, char *in, TOption op);
};
//---------------------------------------------------------------------------
extern PACKAGE TFormMain *FormMain;
//---------------------------------------------------------------------------
#endif