mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-15 09:00:37 +02:00
use new lcl interface methods instead of messages (for win32; twscustomlistview)
git-svn-id: trunk@5849 -
This commit is contained in:
parent
9587978293
commit
59c7ac533f
@ -411,9 +411,7 @@ Var
|
|||||||
//CBI: COMBOBOXINFO;
|
//CBI: COMBOBOXINFO;
|
||||||
DC: HDC;
|
DC: HDC;
|
||||||
Handle: HWND;
|
Handle: HWND;
|
||||||
I, Num, Idx: Integer;
|
I, Num: Integer;
|
||||||
ListItemIndex: TListItem;
|
|
||||||
LVI: LV_ITEM;
|
|
||||||
PStr, PStr2: PChar;
|
PStr, PStr2: PChar;
|
||||||
SizeRect: TRECT; // used by LM_SETSIZE,LM_INVALIDATE,LM_CLB_SET_CHECKED and LM_REDRAW
|
SizeRect: TRECT; // used by LM_SETSIZE,LM_INVALIDATE,LM_CLB_SET_CHECKED and LM_REDRAW
|
||||||
S: String;
|
S: String;
|
||||||
@ -522,74 +520,6 @@ Begin
|
|||||||
begin
|
begin
|
||||||
Result := integer(TWin32CheckListBoxStrings((Sender as TCheckListBox).Items).Checked[PInteger(data)^]);
|
Result := integer(TWin32CheckListBoxStrings((Sender as TCheckListBox).Items).Checked[PInteger(data)^]);
|
||||||
end;
|
end;
|
||||||
LM_LV_DELETEITEM:
|
|
||||||
Begin
|
|
||||||
If Sender Is TListView Then
|
|
||||||
ListView_DeleteItem(Handle, Integer(Data^));
|
|
||||||
End;
|
|
||||||
LM_LV_CHANGEITEM:
|
|
||||||
Begin
|
|
||||||
If Sender Is TListView Then
|
|
||||||
Begin
|
|
||||||
idx := Integer(Data^);
|
|
||||||
ListItemIndex := (Sender As TListView).Items[idx];
|
|
||||||
With LVI Do
|
|
||||||
Begin
|
|
||||||
Mask := LVIF_TEXT;
|
|
||||||
IItem := idx;
|
|
||||||
iSubItem := 0;
|
|
||||||
pszText := PChar(ListItemIndex.Caption);
|
|
||||||
ListView_SetItem(Handle, LVI);
|
|
||||||
End;
|
|
||||||
num := TListView(Sender).Columns.Count - 1;
|
|
||||||
if num > ListItemIndex.SubItems.Count
|
|
||||||
then num := ListItemIndex.SubItems.Count;
|
|
||||||
for i := 1 to num do
|
|
||||||
begin
|
|
||||||
LVI.iSubItem := i;
|
|
||||||
LVI.pszText := PChar(ListItemIndex.SubItems[i - 1]);
|
|
||||||
ListView_SetItem(Handle, LVI);
|
|
||||||
end;
|
|
||||||
for i := num + 1 to TListView(Sender).Columns.Count - 1 do
|
|
||||||
begin
|
|
||||||
LVI.iSubItem := i;
|
|
||||||
LVI.pszText := #0;
|
|
||||||
ListView_SetItem(Handle, LVI);
|
|
||||||
end;
|
|
||||||
End;
|
|
||||||
End;
|
|
||||||
LM_LV_ADDITEM:
|
|
||||||
Begin
|
|
||||||
If Sender Is TListView Then
|
|
||||||
Begin
|
|
||||||
idx := TListView(Sender).Items.Count - 1;
|
|
||||||
ListItemIndex := TListView(Sender).Items[idx];
|
|
||||||
With LVI Do
|
|
||||||
Begin
|
|
||||||
Mask := LVIF_TEXT;
|
|
||||||
iItem := idx;
|
|
||||||
iSubItem := 0;
|
|
||||||
pszText := PChar(ListItemIndex.Caption);
|
|
||||||
End;
|
|
||||||
ListView_InsertItem(Handle, LVI);
|
|
||||||
num := TListView(Sender).Columns.Count - 1;
|
|
||||||
if num > ListItemIndex.SubItems.Count
|
|
||||||
then num := ListItemIndex.SubItems.Count;
|
|
||||||
for i := 1 to num do
|
|
||||||
begin
|
|
||||||
LVI.iSubItem := i;
|
|
||||||
LVI.pszText := PChar(ListItemIndex.SubItems[i - 1]);
|
|
||||||
ListView_SetItem(Handle, LVI);
|
|
||||||
end;
|
|
||||||
for i := num + 1 to TListView(Sender).Columns.Count - 1 do
|
|
||||||
begin
|
|
||||||
LVI.iSubItem := i;
|
|
||||||
LVI.pszText := #0;
|
|
||||||
ListView_SetItem(Handle, LVI);
|
|
||||||
end;
|
|
||||||
|
|
||||||
End;
|
|
||||||
End;
|
|
||||||
LM_BRINGTOFRONT:
|
LM_BRINGTOFRONT:
|
||||||
Begin
|
Begin
|
||||||
Assert(False, 'Trace:TODO: [TWin32WidgetSet.IntSendMessage3] - LM_BRINGTOFRONT');
|
Assert(False, 'Trace:TODO: [TWin32WidgetSet.IntSendMessage3] - LM_BRINGTOFRONT');
|
||||||
@ -3136,6 +3066,9 @@ End;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.228 2004/08/25 17:08:10 micha
|
||||||
|
use new lcl interface methods instead of messages (for win32; twscustomlistview)
|
||||||
|
|
||||||
Revision 1.227 2004/08/25 15:04:44 micha
|
Revision 1.227 2004/08/25 15:04:44 micha
|
||||||
use new lcl interface methods instead of messages (for win32; twsbitbtn)
|
use new lcl interface methods instead of messages (for win32; twsbitbtn)
|
||||||
|
|
||||||
|
@ -120,17 +120,8 @@ const
|
|||||||
LM_SETSELMODE = LM_COMUSER+78;
|
LM_SETSELMODE = LM_COMUSER+78;
|
||||||
LM_SETBORDER = LM_COMUSER+79;
|
LM_SETBORDER = LM_COMUSER+79;
|
||||||
|
|
||||||
// TListView
|
|
||||||
LM_LV_FIRST = LM_COMUSER+80;
|
|
||||||
LM_LV_ADDITEM = LM_LV_FIRST+0;
|
|
||||||
LM_LV_CHANGEITEM = LM_LV_FIRST+1;
|
|
||||||
LM_LV_DELETEITEM = LM_LV_FIRST+2;
|
|
||||||
// LM_LV_SELECTITEM = LM_LV_FIRST+3;
|
|
||||||
// LM_LV_SHOWITEM = LM_LV_FIRST+4;
|
|
||||||
LM_LV_LAST = LM_LV_FIRST+9; // LM_COMUSER+89
|
|
||||||
|
|
||||||
// TComboBox
|
// TComboBox
|
||||||
LM_CB_FIRST = LM_LV_LAST+1; // LM_COMUSER+90
|
LM_CB_FIRST = LM_COMUSER+90; // LM_COMUSER+90
|
||||||
LM_CB_GETCOUNT = LM_CB_FIRST+0;
|
LM_CB_GETCOUNT = LM_CB_FIRST+0;
|
||||||
LM_CB_GETTEXT = LM_CB_FIRST+1;
|
LM_CB_GETTEXT = LM_CB_FIRST+1;
|
||||||
LM_CB_ADDTEXT = LM_CB_FIRST+2;
|
LM_CB_ADDTEXT = LM_CB_FIRST+2;
|
||||||
@ -952,15 +943,6 @@ begin
|
|||||||
LM_SETSELMODE :Result:='LM_SETSELMODE';
|
LM_SETSELMODE :Result:='LM_SETSELMODE';
|
||||||
LM_SETBORDER :Result:='LM_SETBORDER';
|
LM_SETBORDER :Result:='LM_SETBORDER';
|
||||||
|
|
||||||
// TListView
|
|
||||||
//LM_LV_FIRST :Result:='LM_LV_FIRST';
|
|
||||||
LM_LV_ADDITEM :Result:='LM_LV_ADDITEM';
|
|
||||||
LM_LV_CHANGEITEM :Result:='LM_LV_CHANGEITEM';
|
|
||||||
LM_LV_DELETEITEM :Result:='LM_LV_DELETEITEM';
|
|
||||||
// LM_LV_SELECTITEM :Result:='LM_LV_SELECTITEM';
|
|
||||||
// LM_LV_SHOWITEM :Result:='LM_LV_SHOWITEM';
|
|
||||||
//LM_LV_LAST :Result:='LM_LV_LAST';
|
|
||||||
|
|
||||||
// TComboBox
|
// TComboBox
|
||||||
//LM_CB_FIRST :Result:='LM_CB_FIRST';
|
//LM_CB_FIRST :Result:='LM_CB_FIRST';
|
||||||
LM_CB_GETCOUNT :Result:='LM_CB_GETCOUNT';
|
LM_CB_GETCOUNT :Result:='LM_CB_GETCOUNT';
|
||||||
@ -1076,6 +1058,9 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.71 2004/08/25 17:08:10 micha
|
||||||
|
use new lcl interface methods instead of messages (for win32; twscustomlistview)
|
||||||
|
|
||||||
Revision 1.70 2004/08/25 15:04:44 micha
|
Revision 1.70 2004/08/25 15:04:44 micha
|
||||||
use new lcl interface methods instead of messages (for win32; twsbitbtn)
|
use new lcl interface methods instead of messages (for win32; twsbitbtn)
|
||||||
|
|
||||||
|
@ -142,11 +142,6 @@ type
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
|
||||||
// TODO: remove when implemented on win32
|
|
||||||
Controls, LMessages;
|
|
||||||
|
|
||||||
|
|
||||||
{ TWSCustomListView }
|
{ TWSCustomListView }
|
||||||
|
|
||||||
procedure TWSCustomListView.ColumnDelete(const ALV: TCustomListView; const AIndex: Integer);
|
procedure TWSCustomListView.ColumnDelete(const ALV: TCustomListView; const AIndex: Integer);
|
||||||
@ -200,8 +195,6 @@ end;
|
|||||||
|
|
||||||
procedure TWSCustomListView.ItemDelete(const ALV: TCustomListView; const AIndex: Integer);
|
procedure TWSCustomListView.ItemDelete(const ALV: TCustomListView; const AIndex: Integer);
|
||||||
begin
|
begin
|
||||||
// TODO: remove when implemented on win32
|
|
||||||
CNSendMessage(LM_LV_DELETEITEM, ALV ,@AIndex);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TWSCustomListView.ItemGetState(const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem; const AState: TListItemState; var AIsSet: Boolean): Boolean;
|
function TWSCustomListView.ItemGetState(const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem; const AState: TListItemState; var AIsSet: Boolean): Boolean;
|
||||||
@ -212,8 +205,6 @@ end;
|
|||||||
|
|
||||||
procedure TWSCustomListView.ItemInsert(const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem);
|
procedure TWSCustomListView.ItemInsert(const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem);
|
||||||
begin
|
begin
|
||||||
// TODO: remove when implemented on win32
|
|
||||||
CNSendMessage(LM_LV_ADDITEM, ALV, @AIndex);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TWSCustomListView.ItemSetImage(const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem; const ASubIndex, AImageIndex: Integer);
|
procedure TWSCustomListView.ItemSetImage(const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem; const ASubIndex, AImageIndex: Integer);
|
||||||
@ -242,7 +233,7 @@ initialization
|
|||||||
// RegisterWSComponent(TCustomStatusBar, TWSStatusBar);
|
// RegisterWSComponent(TCustomStatusBar, TWSStatusBar);
|
||||||
// RegisterWSComponent(TCustomTabSheet, TWSTabSheet);
|
// RegisterWSComponent(TCustomTabSheet, TWSTabSheet);
|
||||||
// RegisterWSComponent(TCustomPageControl, TWSPageControl);
|
// RegisterWSComponent(TCustomPageControl, TWSPageControl);
|
||||||
RegisterWSComponent(TCustomListView, TWSCustomListView);
|
// RegisterWSComponent(TCustomListView, TWSCustomListView);
|
||||||
// RegisterWSComponent(TCustomListView, TWSListView);
|
// RegisterWSComponent(TCustomListView, TWSListView);
|
||||||
// RegisterWSComponent(TCustomProgressBar, TWSProgressBar);
|
// RegisterWSComponent(TCustomProgressBar, TWSProgressBar);
|
||||||
// RegisterWSComponent(TCustomCustomUpDown, TWSCustomUpDown);
|
// RegisterWSComponent(TCustomCustomUpDown, TWSCustomUpDown);
|
||||||
|
Loading…
Reference in New Issue
Block a user