|
혹시 Component의 크기 조절 기능인
::SendMessage( Panel1->Handle, WM_SYSCOMMAND, SC_SIZE | Action, (LPARAM) 0 );
MouseDown Event에서 처리하는
::ReleaseCapture();
::SendMessage( Handle, WM_SYSCOMMAND, SC_MOVE | 0x02, (LPARAM) 0 );
를 찾으시는 건지...
행운이 있길.... ^_^;;
<< Unit1.Cpp >>
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Panel1MouseDown(TObject *Sender,
TMouseButton Button, TShiftState Shift, int X, int Y)
{
WPARAM pParam[] = {
WMSZ_LEFT,
WMSZ_RIGHT,
WMSZ_TOP,
WMSZ_TOPLEFT,
WMSZ_TOPRIGHT,
WMSZ_BOTTOM,
WMSZ_BOTTOMLEFT,
WMSZ_BOTTOMRIGHT
};
if( ListBox1->ItemIndex == -1 ) {
ListBox1->ItemIndex = 0;
}
::ReleaseCapture();
::SendMessage( Panel1->Handle, WM_SYSCOMMAND, SC_SIZE | pParam[ListBox1->ItemIndex], (LPARAM) 0 );
}
//---------------------------------------------------------------------------
<< Unit1.h >>
//---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TPanel *Panel1;
TListBox *ListBox1;
void __fastcall Panel1MouseDown(TObject *Sender, TMouseButton Button,
TShiftState Shift, int X, int Y);
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
<< Unit1.dfm >>
object Form1: TForm1
Left = 204
Top = 103
Width = 696
Height = 480
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Panel1: TPanel
Left = 272
Top = 188
Width = 185
Height = 89
Caption = 'Panel1'
TabOrder = 0
OnMouseDown = Panel1MouseDown
end
object ListBox1: TListBox
Left = 24
Top = 28
Width = 145
Height = 113
ImeName = 'Microsoft Korean IME 2002'
ItemHeight = 13
Items.Strings = (
' LEFT'
' RIGHT'
' TOP'
' TOPLEFT'
' TOPRIGHT'
' BOTTOM'
' BOTTOMLEFT'
' BOTTOMRIGHT')
TabOrder = 1
end
end
레오 님이 쓰신 글 :
: 맬 질문만 올려서 죄송하게 생각합니다. 열심히 해서 언젠가는 답변만 올리겠습니다...^^
:
: 언제가, 델파이를 사용하던 시절...
:
: 매우 간단하게, 실행후 화면의 비주얼 컴퍼는트를 작성시의 디자이너 처럼, 여덟방향으로 움직일수있는 포인터로 크기롤 조정하고 마우스로 드래그 할수 있었던 기억이 가물가물 납니다.
:
: 이때 코드 한줄로 했었던 기억입니다.(요즘 제가 치매라 환상을 본걸지도 모릅니다...ㅡㅡ)
:
: 빌더에도 이런게 있었나요? 디자인 타임에 동작하는 코드를 어찌어찌하면 될것도 같은데...ㅡㅡ;;;
:
: 무식하서요...이거참...
:
: 방법이 있을까요? 하나하나 그려 가면서 만들고 이벤트 붙이고 하려니 귀찮아 죽겠습니다...ㅜㅜ
|