From 2a2c0c9db6873a623e1c2a9eb054113a578c8aba Mon Sep 17 00:00:00 2001 From: micha Date: Thu, 16 Sep 2004 14:32:31 +0000 Subject: [PATCH] convert LM_SETSELMODE message to interface method git-svn-id: trunk@6014 - --- lcl/include/customlistbox.inc | 7 ++----- lcl/include/toolbar.inc | 4 +++- lcl/interfaces/gtk/gtkint.pp | 8 ++++++-- lcl/interfaces/gtk/gtkobject.inc | 9 +++------ lcl/interfaces/gtk/gtkwsstdctrls.pp | 11 ++++++++++- lcl/interfaces/win32/win32object.inc | 8 +++----- lcl/interfaces/win32/win32wsstdctrls.pp | 8 ++++++++ lcl/lmessages.pp | 10 +++------- lcl/widgetset/wsstdctrls.pp | 7 +++++++ 9 files changed, 45 insertions(+), 27 deletions(-) diff --git a/lcl/include/customlistbox.inc b/lcl/include/customlistbox.inc index 11b7340006..d01a6f2787 100644 --- a/lcl/include/customlistbox.inc +++ b/lcl/include/customlistbox.inc @@ -126,14 +126,11 @@ end; { procedure TCustomListBox.UpdateSelectionMode } {------------------------------------------------------------------------------} procedure TCustomListBox.UpdateSelectionMode; -var - Msg : TLMSetSelMode; begin if not HandleAllocated then exit; - Msg.ExtendedSelect:= ExtendedSelect; - Msg.MultiSelect:= MultiSelect; LockSelectionChange; - CNSendMessage(LM_SETSELMODE, Self, @Msg); + TWSCustomListBoxClass(WidgetSetClass).SetSelectionMode(Self, + ExtendedSelect, MultiSelect); UnlockSelectionChange; end; diff --git a/lcl/include/toolbar.inc b/lcl/include/toolbar.inc index 247e502cd8..673ceb0a6f 100644 --- a/lcl/include/toolbar.inc +++ b/lcl/include/toolbar.inc @@ -1845,7 +1845,6 @@ Begin LM_PAINT : Assert(False, 'Trace:!!!!!!!!!!!!!!!!!LM_PAINT!!!!!!!!!!!!!!'); LM_CONFIGUREEVENT : Assert(False, 'Trace:!!!!!!!!!!!!!!!!!LM_CONFIGUREEVENT!!!!!!!!!!!!!!'); LM_KILLWORD : Assert(False, 'Trace:!!!!!!!!!!!!!!!!!!!!LM_KILLWORD!!!!!!!!!!!!!!!!!!!!'); - LM_SETSELMODE : Assert(False, 'Trace:!!!!!!!!!!!!!!!!!!!!LM_SETSELMODE!!!!!!!!!!!!!!!!'); end; case Message.msg of @@ -2084,6 +2083,9 @@ end; { ============================================================================= $Log$ + Revision 1.31 2004/09/16 14:32:31 micha + convert LM_SETSELMODE message to interface method + Revision 1.30 2004/09/14 14:41:17 micha convert LM_INSERTTOOLBUTTON and LM_DELETETOOLBUTTON messages to interface methods; warning: still very ugly code, as if it is "OldToolbar" so probably, obsolete diff --git a/lcl/interfaces/gtk/gtkint.pp b/lcl/interfaces/gtk/gtkint.pp index 34bbb72526..371a6d59d9 100644 --- a/lcl/interfaces/gtk/gtkint.pp +++ b/lcl/interfaces/gtk/gtkint.pp @@ -226,8 +226,6 @@ type // listbox function GetTopIndex(Sender: TObject): integer;virtual; function SetTopIndex(Sender: TObject; NewTopIndex: integer): integer;virtual; - procedure SetSelectionMode(Sender: TObject; Widget: PGtkWidget; - MultiSelect, ExtendedSelect: boolean); virtual; // forms and dialogs procedure BringFormToFront(Sender: TObject); @@ -300,6 +298,9 @@ type procedure UpdateTransientWindows; virtual; // |-notebook procedure UpdateNotebookPageTab(ANoteBook, APage: TObject);virtual; + // |-listbox + procedure SetSelectionMode(Sender: TObject; Widget: PGtkWidget; + MultiSelect, ExtendedSelect: boolean); virtual; function ForceLineBreaks(DC : hDC; Src: PChar; MaxWidthInPixels : Longint; ProcessAmpersands : Boolean) : PChar; @@ -454,6 +455,9 @@ end. { ============================================================================= $Log$ + Revision 1.206 2004/09/16 14:32:31 micha + convert LM_SETSELMODE message to interface method + Revision 1.205 2004/09/14 10:06:26 micha convert LM_REDRAW message to interface method (in twidgetset) diff --git a/lcl/interfaces/gtk/gtkobject.inc b/lcl/interfaces/gtk/gtkobject.inc index ab6d5e0def..fc8b2c89fa 100644 --- a/lcl/interfaces/gtk/gtkobject.inc +++ b/lcl/interfaces/gtk/gtkobject.inc @@ -3124,12 +3124,6 @@ begin PLMScreenInit(Data)^.ColorDepth:= gdk_visual_get_system^.depth; end; - LM_SETSELMODE: - if Data<>nil then - SetSelectionMode(Sender,PGtkWidget(Handle), - TLMSetSelMode(Data^).MultiSelect, - TLMSetSelMode(Data^).ExtendedSelect); - LM_SETBORDER: {$IFdef GTK2} begin @@ -7962,6 +7956,9 @@ end; { ============================================================================= $Log$ + Revision 1.576 2004/09/16 14:32:31 micha + convert LM_SETSELMODE message to interface method + Revision 1.575 2004/09/16 13:57:30 micha convert LM_SETSEL message to interface method diff --git a/lcl/interfaces/gtk/gtkwsstdctrls.pp b/lcl/interfaces/gtk/gtkwsstdctrls.pp index 8a66e799da..4112d4ccbc 100644 --- a/lcl/interfaces/gtk/gtkwsstdctrls.pp +++ b/lcl/interfaces/gtk/gtkwsstdctrls.pp @@ -34,7 +34,7 @@ uses glib, gdk, gtk, {$Ifndef NoGdkPixbufLib}gdkpixbuf,{$EndIf} GtkFontCache, {$ENDIF} WSStdCtrls, WSLCLClasses, GtkInt, Classes, LCLType, - GTKWinApiWindow, gtkglobals, gtkproc; + GTKWinApiWindow, gtkglobals, gtkproc, InterfaceBase; type @@ -103,6 +103,8 @@ type class function GetItemIndex(const ACustomListBox: TCustomListBox): integer; override; class procedure SelectItem(const ACustomListBox: TCustomListBox; AIndex: integer; ASelected: boolean); override; class procedure SetItemIndex(const ACustomListBox: TCustomListBox; const AIndex: integer); override; + class procedure SetSelectionMode(const ACustomListBox: TCustomListBox; const AExtendedSelect, + AMultiSelect: boolean); override; class procedure SetSorted(const ACustomListBox: TCustomListBox; AList: TStrings; ASorted: boolean); override; end; @@ -456,6 +458,13 @@ begin end; end; +procedure TGtkWSCustomListBox.SetSelectionMode(const ACustomListBox: TCustomListBox; + const AExtendedSelect, AMultiSelect: boolean); +begin + TGtkWidgetSet(InterfaceObject).SetSelectionMode(ACustomListBox, + PGtkWidget(ACustomListBox.Handle), AMultiSelect, AExtendedSelect); +end; + procedure TGtkWSCustomListBox.SetSorted(const ACustomListBox: TCustomListBox; AList: TStrings; ASorted: boolean); begin case ACustomListBox.fCompStyle of diff --git a/lcl/interfaces/win32/win32object.inc b/lcl/interfaces/win32/win32object.inc index 38b562da31..a73996a842 100644 --- a/lcl/interfaces/win32/win32object.inc +++ b/lcl/interfaces/win32/win32object.inc @@ -330,11 +330,6 @@ Begin Else Assert(False, Format('Trace:I don''t know how to destroy component %S', [Sender.ClassName])); End; - LM_SETSELMODE: - Begin - If Sender Is TCustomListBox Then - RecreateWnd(TWinControl(Sender)); - End; LM_SETBORDER: Begin If Sender is TControl Then @@ -2104,6 +2099,9 @@ End; { $Log$ + Revision 1.269 2004/09/16 14:32:31 micha + convert LM_SETSELMODE message to interface method + Revision 1.268 2004/09/16 13:57:30 micha convert LM_SETSEL message to interface method diff --git a/lcl/interfaces/win32/win32wsstdctrls.pp b/lcl/interfaces/win32/win32wsstdctrls.pp index 959165c965..1a0bb4458a 100644 --- a/lcl/interfaces/win32/win32wsstdctrls.pp +++ b/lcl/interfaces/win32/win32wsstdctrls.pp @@ -103,6 +103,8 @@ type class function GetItemIndex(const ACustomListBox: TCustomListBox): integer; override; class procedure SelectItem(const ACustomListBox: TCustomListBox; AIndex: integer; ASelected: boolean); override; class procedure SetItemIndex(const ACustomListBox: TCustomListBox; const AIndex: integer); override; + class procedure SetSelectionMode(const ACustomListBox: TCustomListBox; const AExtendedSelect, + AMultiSelect: boolean); override; class procedure SetStyle(const ACustomListBox: TCustomListBox); override; class procedure SetSorted(const ACustomListBox: TCustomListBox; AList: TStrings; ASorted: boolean); override; end; @@ -315,6 +317,12 @@ begin end; end; +procedure TWin32WSCustomListBox.SetSelectionMode(const ACustomListBox: TCustomListBox; + const AExtendedSelect, AMultiSelect: boolean); +begin + TWin32WidgetSet(InterfaceObject).RecreateWnd(ACustomListBox); +end; + procedure TWin32WSCustomListBox.SetStyle(const ACustomListBox: TCustomListBox); begin // The listbox styles can't be updated, so recreate the listbox diff --git a/lcl/lmessages.pp b/lcl/lmessages.pp index 2219276f08..653597567f 100644 --- a/lcl/lmessages.pp +++ b/lcl/lmessages.pp @@ -72,7 +72,6 @@ const LM_GETSELTEXT = LM_COMUSER+66; LM_SETSELTEXT = LM_COMUSER+67; - LM_SETSELMODE = LM_COMUSER+78; LM_SETBORDER = LM_COMUSER+79; // TComboBox @@ -640,11 +639,6 @@ type TabPosition: Pointer; end; - TLMSetSelMode = record - MultiSelect : boolean; - ExtendedSelect : boolean; - end; - TLMSetChecked = record Index : integer; Checked : boolean; @@ -821,7 +815,6 @@ begin LM_GETSELTEXT :Result:='LM_GETSELTEXT'; LM_SETSELTEXT :Result:='LM_SETSELTEXT'; - LM_SETSELMODE :Result:='LM_SETSELMODE'; LM_SETBORDER :Result:='LM_SETBORDER'; // TComboBox @@ -932,6 +925,9 @@ end. { $Log$ + Revision 1.108 2004/09/16 14:32:31 micha + convert LM_SETSELMODE message to interface method + Revision 1.107 2004/09/16 13:57:29 micha convert LM_SETSEL message to interface method diff --git a/lcl/widgetset/wsstdctrls.pp b/lcl/widgetset/wsstdctrls.pp index 2012994979..b72d93a30f 100644 --- a/lcl/widgetset/wsstdctrls.pp +++ b/lcl/widgetset/wsstdctrls.pp @@ -98,6 +98,8 @@ type class function GetItemIndex(const ACustomListBox: TCustomListBox): integer; virtual; class procedure SelectItem(const ACustomListBox: TCustomListBox; AIndex: integer; ASelected: boolean); virtual; class procedure SetItemIndex(const ACustomListBox: TCustomListBox; const AIndex: integer); virtual; + class procedure SetSelectionMode(const ACustomListBox: TCustomListBox; const AExtendedSelect, + AMultiSelect: boolean); virtual; class procedure SetStyle(const ACustomListBox: TCustomListBox); virtual; class procedure SetSorted(const ACustomListBox: TCustomListBox; AList: TStrings; ASorted: boolean); virtual; end; @@ -218,6 +220,11 @@ procedure TWSCustomListBox.SetItemIndex(const ACustomListBox: TCustomListBox; co begin end; +procedure TWSCustomListBox.SetSelectionMode(const ACustomListBox: TCustomListBox; + const AExtendedSelect, AMultiSelect: boolean); +begin +end; + procedure TWSCustomListBox.SetStyle(const ACustomListBox: TCustomListBox); begin end;