MG: improved streaming error handling

git-svn-id: trunk@795 -
This commit is contained in:
lazarus 2002-02-09 01:46:41 +00:00
parent f0e8121019
commit 328ab9b40f

View File

@ -1152,9 +1152,10 @@ begin
end; end;
pStr := Ampersands2Underscore(PChar(TBitBtn(Sender).Caption)); pStr := Ampersands2Underscore(PChar(TBitBtn(Sender).Caption));
pLabel := gtk_label_new(pstr); pLabel := gtk_label_new(pStr);
Accel:= gtk_label_parse_uline(PGtkLabel(pLabel), pStr); Accel:= gtk_label_parse_uline(PGtkLabel(pLabel), pStr);
gtk_accel_group_add(gtk_accel_group_get_default, Accel, 0, GTK_ACCEL_VISIBLE, PGtkObject(TBitBtn(Sender).Handle), 'clicked'); gtk_accel_group_add(gtk_accel_group_get_default, Accel, 0,
GTK_ACCEL_VISIBLE, PGtkObject(TBitBtn(Sender).Handle), 'clicked');
StrDispose(pStr); StrDispose(pStr);
if (TBitBtn(Sender).Layout = blGlyphLeft) if (TBitBtn(Sender).Layout = blGlyphLeft)
or (TBitBtn(Sender).Layout = blGlyphTop) then or (TBitBtn(Sender).Layout = blGlyphTop) then
@ -2053,9 +2054,11 @@ begin
csColorDialog, csColorDialog,
csFontDialog : gtk_window_set_title(pGtkWindow(p),PLabel); csFontDialog : gtk_window_set_title(pGtkWindow(p),PLabel);
csLabel : begin csLabel :
begin
AccelKey:= GetAccelKey(p); AccelKey:= GetAccelKey(p);
if AccelKey <> 0 then gtk_widget_remove_accelerators(p, 'grab_focus', false); if AccelKey <> 0 then
gtk_widget_remove_accelerators(p, 'grab_focus', false);
if TLabel(Sender).ShowAccelChar then begin if TLabel(Sender).ShowAccelChar then begin
aLabel:= Ampersands2Underscore(pLabel); aLabel:= Ampersands2Underscore(pLabel);
@ -2063,7 +2066,8 @@ begin
AccelKey:= gtk_label_parse_uline(pGtkLabel(p), aLabel); AccelKey:= gtk_label_parse_uline(pGtkLabel(p), aLabel);
SetAccelKey(p, AccelKey); SetAccelKey(p, AccelKey);
if AccelKey <> 0 then if AccelKey <> 0 then
gtk_widget_add_accelerator(p, 'grab_focus', gtk_accel_group_get_default(), gtk_widget_add_accelerator(p, 'grab_focus',
gtk_accel_group_get_default(),
AccelKey, GDK_MOD1_MASK, GTK_ACCEL_VISIBLE); AccelKey, GDK_MOD1_MASK, GTK_ACCEL_VISIBLE);
finally finally
StrDispose(aLabel); StrDispose(aLabel);
@ -2305,6 +2309,11 @@ begin
end; end;
end; end;
LM_GRABFOCUS:
begin
ConnectSenderSignal(gObject, 'grab_focus', @gtkActivateCB);
end;
LM_KEYDOWN, LM_KEYDOWN,
LM_CHAR, LM_CHAR,
LM_KEYUP, LM_KEYUP,
@ -2805,11 +2814,12 @@ begin
SetCallback(LM_CLICKED,Sender); SetCallback(LM_CLICKED,Sender);
End; End;
csFixed : csCalendar:
Begin Begin
SetCallback(LM_HSCROLL,Sender); SetCallback(LM_MONTHCHANGED,Sender);
SetCallback(LM_VSCROLL,Sender); SetCallback(LM_YEARCHANGED,Sender);
end; SetCallback(LM_DAYCHANGED,Sender);
End;
csComboBox,csNotebook,csTrackBar : csComboBox,csNotebook,csTrackBar :
Begin Begin
@ -2824,6 +2834,12 @@ begin
SetCallback(LM_PASTEFROMCLIP,Sender); SetCallback(LM_PASTEFROMCLIP,Sender);
End; End;
csFixed :
Begin
SetCallback(LM_HSCROLL,Sender);
SetCallback(LM_VSCROLL,Sender);
end;
csForm: csForm:
Begin Begin
SetCallback(LM_CONFIGUREEVENT,Sender); SetCallback(LM_CONFIGUREEVENT,Sender);
@ -2831,12 +2847,10 @@ begin
SetCallBack(LM_Activate,Sender); SetCallBack(LM_Activate,Sender);
end; end;
csCalendar: csLabel:
Begin Begin
SetCallback(LM_MONTHCHANGED,Sender); SetCallback(LM_GRABFOCUS,Sender);
SetCallback(LM_YEARCHANGED,Sender); end;
SetCallback(LM_DAYCHANGED,Sender);
End;
csListview: csListview:
begin begin
@ -3717,7 +3731,6 @@ begin
P := gtk_label_new(StrTemp); P := gtk_label_new(StrTemp);
gtk_label_set_justify(PGtkLabel(P), GTK_JUSTIFY_LEFT); gtk_label_set_justify(PGtkLabel(P), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment(PGTKMISC(P), 0.0 , 0.0); gtk_misc_set_alignment(PGTKMISC(P), 0.0 , 0.0);
gtk_signal_connect(p, 'grab_focus', gtk_signal_func(@gtkactivateCB), Sender);
end; end;
csListBox : csListBox :
@ -5672,7 +5685,11 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.196 2002/09/04 09:32:17 lazarus
MG: improved streaming error handling
Revision 1.195 2002/09/03 11:32:49 lazarus Revision 1.195 2002/09/03 11:32:49 lazarus
Added shortcut keys to labels Added shortcut keys to labels
Support for alphabetically sorting the properties Support for alphabetically sorting the properties
Standardize message and add shortcuts ala Kylix Standardize message and add shortcuts ala Kylix