Merged revision(s) 42916 #d8f7a4df0a, 42923-42924 #3b6ec447bf-#3b6ec447bf, 42931-42932 #30f778a891-#30f778a891, 42936 #c33a15d30d, 42940-42941 #84d84eb479-#84d84eb479 from trunk:

IDE: Improve the All Compiler Options GUI filter. It lost focus because it was disabled. Not any more.
........
LCL, Gtk2, fix grid editing problem on ALT+TAB forward and back, issue #22475
........
LCL, Gtk2, force redraw of GTKWinApiWidgets on focus changes so they can reflect focused/unfocused state (for grids in this case)
........
Debugger: Options, disable add/remove buttons on signal opts. Not implemented
........
Debugger: Options, mark project as modified, when exceptions are enabled/disabled. Issue #0025074
........
LCL, grids, handle the first key in keypress, fixes issue #24893
........
Qt: fixed TQtCheckListBox double click event duplication.issue #25089
........
Qt: change current row of TQtCheckListBox for Qt >= 4.8 since it does not change ItemIndex when checkbox is clicked.
........

git-svn-id: branches/fixes_1_2@43007 -
This commit is contained in:
martin 2013-09-28 11:35:34 +00:00
parent ced808e8cd
commit 3526881fa4
8 changed files with 172 additions and 103 deletions

View File

@ -104,6 +104,9 @@ var
begin
for n := 0 to DebugBoss.Signals.Count - 1 do
AddSignalLine(DebugBoss.Signals[n]);
cmdSignalAdd.Enabled := False; // not implemented
cmdSignalRemove.Enabled := False; // not implemented
end;
procedure TDebuggerSignalsOptions.WriteSettings(AOptions: TAbstractIDEOptions);

View File

@ -7,59 +7,30 @@ object frmAllCompilerOptions: TfrmAllCompilerOptions
ClientHeight = 497
ClientWidth = 622
OnShow = FormShow
LCLVersion = '1.1'
object edOptionsFilter: TEdit
AnchorSideTop.Side = asrBottom
LCLVersion = '1.3'
object sbAllOptions: TScrollBox
Left = 0
Height = 25
Top = 0
Width = 98
OnChange = edOptionsFilterChange
Height = 411
Top = 34
Width = 622
HorzScrollBar.Increment = 61
HorzScrollBar.Page = 618
HorzScrollBar.Smooth = True
HorzScrollBar.Tracking = True
VertScrollBar.Increment = 40
VertScrollBar.Page = 407
VertScrollBar.Smooth = True
VertScrollBar.Tracking = True
Align = alClient
Anchors = []
ParentShowHint = False
ShowHint = True
TabOrder = 0
end
object btnResetOptionsFilter: TSpeedButton
AnchorSideLeft.Control = edOptionsFilter
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = edOptionsFilter
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Side = asrBottom
Left = 98
Height = 25
Top = 0
Width = 29
OnClick = btnResetOptionsFilterClick
ShowHint = True
ParentShowHint = False
end
object sbAllOptions: TScrollBox
AnchorSideLeft.Control = edOptionsFilter
AnchorSideTop.Control = edOptionsFilter
AnchorSideTop.Side = asrBottom
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = ButtonPanel1
Left = 0
Height = 419
Top = 25
Width = 616
HorzScrollBar.Increment = 61
HorzScrollBar.Page = 612
HorzScrollBar.Smooth = True
HorzScrollBar.Tracking = True
VertScrollBar.Increment = 41
VertScrollBar.Page = 415
VertScrollBar.Smooth = True
VertScrollBar.Tracking = True
Anchors = [akTop, akLeft, akRight, akBottom]
ParentShowHint = False
ShowHint = True
TabOrder = 1
end
object ButtonPanel1: TButtonPanel
Left = 6
Height = 41
Top = 450
Height = 40
Top = 451
Width = 610
OKButton.Name = 'OKButton'
OKButton.DefaultCaption = True
@ -69,33 +40,68 @@ object frmAllCompilerOptions: TfrmAllCompilerOptions
CloseButton.DefaultCaption = True
CancelButton.Name = 'CancelButton'
CancelButton.DefaultCaption = True
TabOrder = 2
TabOrder = 1
ShowButtons = [pbOK, pbCancel, pbHelp]
end
object cbShowModified: TCheckBox
AnchorSideLeft.Control = btnResetOptionsFilter
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = btnResetOptionsFilter
AnchorSideTop.Side = asrCenter
Left = 156
Height = 21
Top = 2
Width = 143
BorderSpacing.Left = 29
Caption = 'Show only modified'
OnClick = cbShowModifiedClick
TabOrder = 3
end
object cbUseComments: TCheckBox
AnchorSideLeft.Control = cbShowModified
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = cbShowModified
Left = 328
Height = 21
Top = 2
Width = 233
BorderSpacing.Left = 29
Caption = 'Use comments in custom options'
TabOrder = 4
object pnlFilter: TPanel
Left = 0
Height = 34
Top = 0
Width = 622
Align = alTop
ClientHeight = 34
ClientWidth = 622
TabOrder = 2
object edOptionsFilter: TEdit
AnchorSideTop.Side = asrBottom
Left = 3
Height = 24
Top = 3
Width = 98
OnChange = edOptionsFilterChange
ParentShowHint = False
ShowHint = True
TabOrder = 0
end
object btnResetOptionsFilter: TSpeedButton
AnchorSideLeft.Control = edOptionsFilter
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = edOptionsFilter
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Side = asrBottom
Left = 101
Height = 25
Top = 3
Width = 29
OnClick = btnResetOptionsFilterClick
ShowHint = True
ParentShowHint = False
end
object cbShowModified: TCheckBox
AnchorSideLeft.Control = btnResetOptionsFilter
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = btnResetOptionsFilter
AnchorSideTop.Side = asrCenter
Left = 159
Height = 21
Top = 5
Width = 135
BorderSpacing.Left = 29
Caption = 'Show only modified'
OnClick = cbShowModifiedClick
TabOrder = 1
end
object cbUseComments: TCheckBox
AnchorSideLeft.Control = cbShowModified
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = cbShowModified
Left = 323
Height = 21
Top = 5
Width = 218
BorderSpacing.Left = 29
Caption = 'Use comments in custom options'
TabOrder = 2
end
end
end

View File

@ -6,7 +6,7 @@ interface
uses
Classes, SysUtils, Forms, Controls, StdCtrls, Buttons, ButtonPanel, EditBtn,
Dialogs, contnrs, LCLProc, ComCtrls, Compiler, LazarusIDEStrConsts;
Dialogs, contnrs, LCLProc, ComCtrls, ExtCtrls, Compiler, LazarusIDEStrConsts;
type
@ -18,6 +18,7 @@ type
cbShowModified: TCheckBox;
cbUseComments: TCheckBox;
edOptionsFilter: TEdit;
pnlFilter: TPanel;
sbAllOptions: TScrollBox;
procedure btnResetOptionsFilterClick(Sender: TObject);
procedure cbShowModifiedClick(Sender: TObject);
@ -78,7 +79,6 @@ end;
procedure TfrmAllCompilerOptions.FormShow(Sender: TObject);
begin
Caption:=lisAllOptions;
edOptionsFilter.Enabled := False; // Until the options are read.
edOptionsFilter.Hint := lisFilterTheAvailableOptionsList;
btnResetOptionsFilter.LoadGlyphFromLazarusResource(ResBtnListFilter);
btnResetOptionsFilter.Enabled := False;
@ -134,14 +134,12 @@ begin
IdleConnected := False;
Screen.Cursor := crHourGlass;
try
edOptionsFilter.Enabled := False;
FOptionsThread.WaitFor; // Make sure the options are read.
if FOptionsReader.ErrorMsg <> '' then
DebugLn(FOptionsReader.ErrorMsg)
else begin
StartTime := Now;
RenderAndFilterOptions;
edOptionsFilter.Enabled := True;
DebugLn(Format('AllCompilerOptions: Time for reading options: %s, rendering GUI: %s',
[FormatTimeWithMs(FOptionsThread.ReadTime),
FormatTimeWithMs(Now-StartTime)]));
@ -313,10 +311,7 @@ begin
RenderOneLevel(FOptionsReader.RootOptGroup);
FEffectiveFilter := edOptionsFilter.Text;
FEffectiveShowModified := cbShowModified.Checked;
{$IFDEF AllOptsFocusFilter}
if FRenderedOnce then
FocusControl(edOptionsFilter);
{$ENDIF}
FocusControl(edOptionsFilter);
finally
Container.EnableAutoSizing;
Container.Invalidate;

View File

@ -301,6 +301,7 @@ type
protected
procedure SetIgnoreAll(const AValue: Boolean); override;
procedure Notify(Item: TCollectionItem; Action: TCollectionNotification); override;
procedure Update(Item: TCollectionItem); override;
end;
TDBGEventCategories = set of TDBGEventCategory;
@ -322,6 +323,13 @@ begin
Project1.Modified := True;
end;
procedure TProjectExceptions.Update(Item: TCollectionItem);
begin
inherited Update(Item);
if Project1 <> nil then
Project1.Modified := True;
end;
{ TManagedBreakPoints }
constructor TManagedBreakPoints.Create(const AManager: TDebugManager);

View File

@ -846,7 +846,6 @@ type
procedure WriteRowHeights(Writer: TWriter);
procedure WMEraseBkgnd(var message: TLMEraseBkgnd); message LM_ERASEBKGND;
procedure WMGetDlgCode(var Msg: TLMNoParams); message LM_GETDLGCODE;
procedure WMChar(var message: TLMChar); message LM_CHAR;
protected
fGridState: TGridState;
class procedure WSRegisterClass; override;
@ -4510,22 +4509,6 @@ begin
inherited WMSetFocus(Message);
end;
procedure TCustomGrid.WMChar(var message: TLMChar);
var
Ch: Char;
begin
Ch:=Char(message.CharCode);
{$Ifdef GridTraceMsg}
DebugLn(ClassName,'.WMchar CharCode= ', IntToStr(message.CharCode));
{$Endif}
if EditingAllowed(FCol) and (Ch in [^H, #32..#255]) then begin
EditorShowChar(Ch);
message.CharCode := 0;
message.Result := 1;
end else
inherited;
end;
class procedure TCustomGrid.WSRegisterClass;
begin
inherited WSRegisterClass;
@ -6740,9 +6723,15 @@ end;
procedure TCustomGrid.KeyPress(var Key: char);
begin
inherited KeyPress(Key);
if (Key=#13) and EditingAllowed(FCol) then begin
EditorShow(True);
Key := #0;
if not EditorMode and EditingAllowed(FCol) then begin
if (Key=#13) then begin
EditorShow(True);
Key := #0;
end else
if (Key in [^H, #32..#255]) then begin
EditorShowChar(Key);
Key := #0;
end;
end;
end;

View File

@ -735,6 +735,43 @@ begin
DeliverGtkPaintMessage(Data,Widget,@Event^.Area,false,true);
end;
procedure ClearTopLevelsFocus(Win: PGtkWidget);
var
List: PGList;
Window: PGtkWindow;
event: PGdkEvent;
TopLevelWin: PGdkWindow;
begin
if not GTK_IS_WINDOW(win) then
exit;
List := gdk_window_get_toplevels;
while List <> nil do
begin
TopLevelWin := PGdkWindow(List^.Data);
if (TopLevelWin<>nil) and (TopLevelWin<>Win^.Window) then
begin
gdk_window_get_user_data(TopLevelWin, Pgpointer(@Window));
if GTK_IS_WINDOW(Window)
and GTK_WIDGET_VISIBLE(Window)
and gtk_window_has_TopLevel_Focus(Window) then
begin
// fake focus-out event
{.$IFDEF VerboseFocus}
DebugLn('NOTE: Window with stalled focus found!, faking focus-out event');
{.$ENDIF}
event := gdk_event_new(GDK_FOCUS_CHANGE);
event^.focus_change.window := TopLevelWin;
event^.focus_change._type := GDK_FOCUS_CHANGE;
event^.focus_change._in:=0;
gtk_main_do_event(event);
end;
end;
list := g_list_next(list);
end;
end;
function gtkfrmactivateAfter(widget: PGtkWidget; Event : PgdkEventFocus;
data: gPointer) : GBoolean; cdecl;
var
@ -945,14 +982,22 @@ begin
EventTrace('focus', data);
{$ENDIF}
if (Widget=nil) or (Event=nil) then ;
//DebugLn('GTKFocusCBAfter ',DbgSName(TObject(Data)),' ',GetWidgetDebugReport(Widget));
//DebugLn('GTKFocusCB ',DbgSName(TObject(Data)),' ',GetWidgetDebugReport(Widget));
LCLObject:=TObject(data);
if (widget<>nil) and GTK_IS_WINDOW(widget) and (LCLObject is TCustomForm) then
begin
// it's a top level window about to be focused, if we are being focused
// because of ALT+TABing to this form, the origin form might be left with
// invalid focus information (ALT+TAB doesn't trigger focus-out event on those)
ClearTopLevelsFocus(Widget);
end;
NeedShiftUpdateAfternFocus := False;
gdk_window_get_pointer(nil, nil, nil, @Mask);
UpdateShiftState(TGtk2WidgetSet(WidgetSet).KeyStateList, GTKEventStateToShiftState(Word(Mask)));
LCLObject:=TObject(data);
{$IFDEF VerboseFocus}
write('GTKFocusCBAfter Widget=',DbgS(Widget),' Event^.theIn=',Event^._in);
if LCLObject<>nil then begin

View File

@ -442,6 +442,7 @@ begin
gtk_widget_set_flags(AWidget, GTK_HAS_FOCUS);
GTKAPIWidgetClient_DrawCaret(PGTKAPIWidgetClient(AWidget), False);
gtk_widget_queue_draw(AWidget);
Result := gtk_False;
end;
@ -454,6 +455,7 @@ begin
gtk_widget_unset_flags(AWidget, GTK_HAS_FOCUS);
GTKAPIWidgetClient_DrawCaret(PGTKAPIWidgetClient(AWidget), False);
gtk_widget_queue_draw(AWidget);
Result := gtk_False;
end;

View File

@ -1284,6 +1284,7 @@ type
procedure AttachEvents; override;
procedure DetachEvents; override;
function EventFilter(Sender: QObjectH; Event: QEventH): Boolean; cdecl; override;
function itemViewViewportEventFilter(Sender: QObjectH; Event: QEventH): Boolean; cdecl; override;
procedure signalCurrentItemChanged(current: QListWidgetItemH; previous: QListWidgetItemH); cdecl; override;
@ -11764,6 +11765,16 @@ begin
inherited DetachEvents;
end;
function TQtCheckListBox.EventFilter(Sender: QObjectH; Event: QEventH
): Boolean; cdecl;
begin
Result := False;
if (QEvent_type(Event) = QEventMouseButtonDblClick) then
// issue #25089
else
Result:=inherited EventFilter(Sender, Event);
end;
function TQtCheckListBox.itemViewViewportEventFilter(Sender: QObjectH;
Event: QEventH): Boolean; cdecl;
var
@ -11792,6 +11803,16 @@ begin
QWidget_releaseMouse(QWidgetH(Sender));
end else
Result := SlotMouse(Sender, Event);
if (QtVersionMajor = 4) and (QtVersionMinor >= 8) and
(QEvent_Type(Event) = QEventMouseButtonPress) then
begin
// change current row , this works fine with qt < 4.8
if Assigned(Item) and (currentItem <> Item) then
begin
// DebugLn('TQtCheckListBox forced item change');
Self.setCurrentItem(Item, True);
end;
end;
end;
else
begin