Re: [lazarus] patch fo tLabel
I guess you can do something like in cvs: e.g. svn up -j 9501 -j 9500 MyFile.pas If you're using Windows, latest TortoiseSVN has command 'Revert changes from these revisions' in Log dialog. Cheers, Flávio On 4/6/06, Graeme Geldenhuys <[EMAIL PROTECTED]> wrote: > On 05/04/06, Vincent Snijders <[EMAIL PROTECTED]> wrote: > > This patch seems to be applied in 8956, but it breaks expected > > behaviour, see http://www.lazarus.freepascal.org/mantis/view.php?id=1964. > > > > Can I revert that patch? > > > Hi Vincent, > > This has nothing to do with this thread. I am fairly new to svn. How > do you revert a patch that was applied a few revisions before? > Manually undo what the patch did by editing the code, or modify the > patch file somehow and reapply it? > > Regards, > - Graeme - > > > -- > There's no place like 127.0.0.1 > > _ > To unsubscribe: mail [EMAIL PROTECTED] with > "unsubscribe" as the Subject >archives at http://www.lazarus.freepascal.org/mailarchives > _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] patch fo tLabel
On 05/04/06, Vincent Snijders <[EMAIL PROTECTED]> wrote: > This patch seems to be applied in 8956, but it breaks expected > behaviour, see http://www.lazarus.freepascal.org/mantis/view.php?id=1964. > > Can I revert that patch? Hi Vincent, This has nothing to do with this thread. I am fairly new to svn. How do you revert a patch that was applied a few revisions before? Manually undo what the patch did by editing the code, or modify the patch file somehow and reapply it? Regards, - Graeme - -- There's no place like 127.0.0.1 _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] patch fo tLabel
On Wed, 05 Apr 2006 21:33:37 +0200 Vincent Snijders <[EMAIL PROTECTED]> wrote: > Mattias Gaertner wrote: > > On Sat, 18 Mar 2006 16:04:12 +0100 > > darekM <[EMAIL PROTECTED]> wrote: > > > > > >>[...] > >> > Index: include/customlabel.inc > === > --- include/customlabel.inc(wersja 8956) > +++ include/customlabel.inc(kopia robocza) > @@ -39,7 +39,8 @@ > R := Rect(0,0, Width, Height); > OldFont:=SelectObject(DC, Font.Handle); > Flags:=DT_CalcRect; > -if WordWrap then inc(Flags,DT_WordBreak); > +if WordWrap then inc(Flags,DT_WordBreak) > +else inc(Flags,DT_SingleLine); > > >>> > >>>From > >>>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcefo > >nts/html/cecondrawtext.asp: >> > >>>DT_SINGLELINE Displays text on a single line only. Carriage > >>>returns and linefeeds do not break the line. > >>> > >>>Setting DT_SINGLELINE would prohibit to use custom line breaks. > >>> > >> > >>if WordWrap=false then label should be in one line (eq. singleline), > >>calculate rectangle should care about it, > >> when not DT_SINGLELINE include, draw text is use more complicated > >part. >tLabel in most cases is single line > >>We have three cases: > >>1. single line, > >>2. multiple line divide by carriage return > >>3. multiple line divide by carriage return and anywhere - when is not > >>insufficient place > >> > >>in tLabel we have only WordWrap property, for me its not the same like > >>dt_wordWrap only differ from single and multiple line, > >>tLabel must not difference case 2 and 3, in most cases is the same, only > > > >>cases 1 and 3 > > > > > > Why should TLabel ignore user's line breaks when WordWrap=false? > > Do you think, it is this too complicated for the widgetsets? > > This patch seems to be applied in 8956, but it breaks expected > behaviour, see http://www.lazarus.freepascal.org/mantis/view.php?id=1964. > > Can I revert that patch? > > IMHO, the user can make a difference between 1 and 2 by adding > LineEndings in its text and between 1 and 3 by setting WordWrap to true. > Note that AutoSize won't enlarged the width of label, unless the longest > word doesn't fit, if you set WordWrap to true. Fixed for label and speedbutton. Mattias _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] patch fo tLabel
Vincent Snijders wrote: Mattias Gaertner wrote: On Sat, 18 Mar 2006 16:04:12 +0100 darekM <[EMAIL PROTECTED]> wrote: DT_SINGLELINE Displays text on a single line only. Carriage returns and linefeeds do not break the line. Setting DT_SINGLELINE would prohibit to use custom line breaks. if WordWrap=false then label should be in one line (eq. singleline), calculate rectangle should care about it, when not DT_SINGLELINE include, draw text is use more complicated part. tLabel in most cases is single line We have three cases: 1. single line, 2. multiple line divide by carriage return 3. multiple line divide by carriage return and anywhere - when is not insufficient place in tLabel we have only WordWrap property, for me its not the same like dt_wordWrap only differ from single and multiple line, tLabel must not difference case 2 and 3, in most cases is the same, only cases 1 and 3 Why should TLabel ignore user's line breaks when WordWrap=false? Do you think, it is this too complicated for the widgetsets? This patch seems to be applied in 8956, but it breaks expected behaviour, see http://www.lazarus.freepascal.org/mantis/view.php?id=1964. Can I revert that patch? IMHO, the user can make a difference between 1 and 2 by adding LineEndings in its text and between 1 and 3 by setting WordWrap to true. Note that AutoSize won't enlarged the width of label, unless the longest word doesn't fit, if you set WordWrap to true. I have taken a better look and I propose this patch: Vincent Index: customlabel.inc === --- customlabel.inc (revision 9073) +++ customlabel.inc (working copy) @@ -365,11 +365,7 @@ FillChar(TR,SizeOf(TR),0); With TR do begin Alignment := Self.Alignment; - if wordWrap then begin -WordBreak := True; - end else begin -SingleLine:=true; - end; + WordBreak := WordWrap; Clipping := True; ShowPrefix := ShowAccelChar; SystemFont:=false; _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] patch fo tLabel
Mattias Gaertner wrote: On Sat, 18 Mar 2006 16:04:12 +0100 darekM <[EMAIL PROTECTED]> wrote: [...] Index: include/customlabel.inc === --- include/customlabel.inc(wersja 8956) +++ include/customlabel.inc(kopia robocza) @@ -39,7 +39,8 @@ R := Rect(0,0, Width, Height); OldFont:=SelectObject(DC, Font.Handle); Flags:=DT_CalcRect; -if WordWrap then inc(Flags,DT_WordBreak); +if WordWrap then inc(Flags,DT_WordBreak) +else inc(Flags,DT_SingleLine); From http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcefonts/html/cecondrawtext.asp: DT_SINGLELINE Displays text on a single line only. Carriage returns and linefeeds do not break the line. Setting DT_SINGLELINE would prohibit to use custom line breaks. if WordWrap=false then label should be in one line (eq. singleline), calculate rectangle should care about it, when not DT_SINGLELINE include, draw text is use more complicated part. tLabel in most cases is single line We have three cases: 1. single line, 2. multiple line divide by carriage return 3. multiple line divide by carriage return and anywhere - when is not insufficient place in tLabel we have only WordWrap property, for me its not the same like dt_wordWrap only differ from single and multiple line, tLabel must not difference case 2 and 3, in most cases is the same, only cases 1 and 3 Why should TLabel ignore user's line breaks when WordWrap=false? Do you think, it is this too complicated for the widgetsets? This patch seems to be applied in 8956, but it breaks expected behaviour, see http://www.lazarus.freepascal.org/mantis/view.php?id=1964. Can I revert that patch? IMHO, the user can make a difference between 1 and 2 by adding LineEndings in its text and between 1 and 3 by setting WordWrap to true. Note that AutoSize won't enlarged the width of label, unless the longest word doesn't fit, if you set WordWrap to true. Vincent _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] patch fo tLabel
On Sat, 18 Mar 2006 22:53:36 +0100 darekm <[EMAIL PROTECTED]> wrote: > Mattias Gaertner wrote: > > >On Sat, 18 Mar 2006 13:35:51 +0100 > >darekm <[EMAIL PROTECTED]> wrote: > > > > > > > >>[...] > >>Darek > >>PS. What's about my previously patch (tComboBox) > >> now I have much more investigation: > >> 1. for tSpeedButton: caption is paint in improper place (row for > >>caption 'zoom' and 'insert' is not the same for fonts other than > >defaults > 2. added some improvements for debugging > >> 3. repairedfunction FindLineEnd(LineStart: integer) for text in > >UTF8 > 4. for tComboBox select signal is fired only one time per click > >> > >> Can can somebody test it. > >> > >> > > > >patching file interfaces/gtk/gtkproc.pp > >Reversed (or previously applied) patch detected! Assume -R? [n] > > > > > Sorry, too huge patch > > > > >BTW: never use writeln. > > > > > I use it by habit, I not caught this one. > > > > > > >>I have one more patch (tComboBox grab capture and not release them, but > >>I must stopping without finish this changes) > >> > >> > In this patch this is resolved, too. (When tComboBox is first component > on Form, Gtk enable grab capture for it and not release. Buttons on the > same Form not receive any signal - moving mouse above not cause change > color (button not change state to GTK_STATE_PRELIGHT) > > > Darek > > PS. If this is needed, I can divide to smaller one. Applied. Thanks. Do you know, why selecting a combobox on editor options and pressing Escape raises an exception? Mattias _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] patch fo tLabel
Mattias Gaertner wrote: On Sat, 18 Mar 2006 13:35:51 +0100 darekm <[EMAIL PROTECTED]> wrote: [...] Darek PS. What's about my previously patch (tComboBox) now I have much more investigation: 1. for tSpeedButton: caption is paint in improper place (row for caption 'zoom' and 'insert' is not the same for fonts other than defaults 2. added some improvements for debugging 3. repairedfunction FindLineEnd(LineStart: integer) for text in UTF8 4. for tComboBox select signal is fired only one time per click Can can somebody test it. patching file interfaces/gtk/gtkproc.pp Reversed (or previously applied) patch detected! Assume -R? [n] Sorry, too huge patch BTW: never use writeln. I use it by habit, I not caught this one. I have one more patch (tComboBox grab capture and not release them, but I must stopping without finish this changes) In this patch this is resolved, too. (When tComboBox is first component on Form, Gtk enable grab capture for it and not release. Buttons on the same Form not receive any signal - moving mouse above not cause change color (button not change state to GTK_STATE_PRELIGHT) Darek PS. If this is needed, I can divide to smaller one. Index: interfaces/gtk/gtkproc.inc === --- interfaces/gtk/gtkproc.inc (wersja 8959) +++ interfaces/gtk/gtkproc.inc (kopia robocza) @@ -3444,7 +3444,8 @@ begin if Target=nil then DebugLn('[DeliverMessage] Target = nil'); {$IFDEF VerboseDeliverMessage} - DebugLn('DeliverMessage ',DbgS(Target), + if TLMessage(AMessage).Msg<>LM_MOUSEMOVE then +DebugLn('DeliverMessage ',DbgS(Target), ' ',TComponent(Target).Name,':',TObject(Target).ClassName, ' Message=',GetMessageName(TLMessage(AMessage).Msg)); {$ENDIF} @@ -4419,6 +4420,9 @@ DebugLn('UpdateMouseCaptureControl Capture changed from ', '[',GetWidgetDebugReport(OldMouseCaptureWidget),']', ' to [',GetWidgetDebugReport(CurMouseCaptureWidget),']'); +if CurMouseCaptureWidget<>nil then +DebugLn('parent ',GetWidgetDebugReport(CurMouseCaptureWidget^.Parent)); + {$ENDIF} // notify the new capture control @@ -4531,6 +4535,22 @@ SetCaptureControl(nil); end; + +procedure ReleaseCaptureWidget(Widget : PGtkWidget); +begin + if (MouseCaptureWidget=nil) or (Widget=nil) then exit; + if (MouseCaptureWidget<>Widget) and (MouseCaptureWidget<>Widget^.parent) then exit; + + {.$IFDEF VerboseMouseCapture} + DebugLn('ReleaseCaptureControl ',dbgs(ord(MouseCaptureType)),' MouseCaptureWidget=[',GetWidgetDebugReport(MouseCaptureWidget),']'); + {.$ENDIF} + gtk_grab_remove(MouseCaptureWidget); + MouseCaptureWidget:=nil; + MouseCaptureType:=mctGTK; + SetCaptureControl(nil); +end; + + {-- procedure: SetCursor Params: AWinControl : TWinControl Index: interfaces/gtk/gtkcallback.inc === --- interfaces/gtk/gtkcallback.inc (wersja 8959) +++ interfaces/gtk/gtkcallback.inc (kopia robocza) @@ -395,7 +395,9 @@ begin //DebugLn('gtktoggledCB ',DbgSName(TObject(Data))); Result := CallBackDefaultReturn; + {$IFDEF EventTrace} EventTrace('toggled', data); + {$ENDIF} if LockOnChange(PgtkObject(Widget),0) > 0 then Exit; if GtkWidgetIsA(Widget,gtk_toggle_button_get_type) then begin @@ -415,7 +417,9 @@ DesignOnlySignal: boolean; begin Result := CallBackDefaultReturn; + {$IFDEF EventTrace} EventTrace('DrawAfter', data); + {$ENDIF} if not (csDesigning in TComponent(Data).ComponentState) then begin DesignOnlySignal:=GetDesignOnlySignalFlag(Widget,dstDrawAfter); @@ -440,7 +444,9 @@ DesignOnlySignal: boolean; begin Result := CallBackDefaultReturn; + {$IFDEF EventTrace} EventTrace('ExposeAfter', data); + {$ENDIF} if (Event^.Count > 0) then exit; if not (csDesigning in TComponent(Data).ComponentState) then begin @@ -451,7 +457,7 @@ DebugLn('gtkExposeAfter', ' Widget=',DbgS(Widget),'=',GetWidgetClassName(Widget), ' ',TComponent(Data).Name, - ' ',Event^.area.x,',',Event^.area.y,',',Event^.area.width,',',Event^.area.height, + ' ',dbgs(Event^.area.x),',',dbgs(Event^.area.y),',',dbgs(Event^.area.width),',',dbgs(Event^.area.height), ''); {$ENDIF} end; @@ -470,7 +476,9 @@ CurFocusWidget: PGtkWidget; {$ENDIF} begin + {$IFDEF EventTrace} EventTrace('activate after', data); + {$ENDIF} if (Widget=nil) or (Event=nil) then ; FillChar(Mess,SizeOf(Mess),#0); {$IFDEF VerboseFocus} @@ -524,7 +532,9 @@ LCLObject: TControl; {$ENDIF} begin + {$IFDEF EventTrace} EventTrace('deactivate after', data); + {$ENDIF} if (Widget=nil) or (Event=nil) then ; {$IFDEF VerboseFocus} write('gtkfrmdeactivate Widget=',DbgS(Widget),' ',Event^.theIn, @@ -649,12 +659,10 @@ {$ENDIF} UpdateMouseCaptureControl; -
Re: [lazarus] patch fo tLabel
On Sat, 18 Mar 2006 13:35:51 +0100 darekm <[EMAIL PROTECTED]> wrote: >[...] > Darek > PS. What's about my previously patch (tComboBox) > now I have much more investigation: > 1. for tSpeedButton: caption is paint in improper place (row for > caption 'zoom' and 'insert' is not the same for fonts other than defaults > 2. added some improvements for debugging > 3. repairedfunction FindLineEnd(LineStart: integer) for text in UTF8 > 4. for tComboBox select signal is fired only one time per click > > Can can somebody test it. Testresult: patching file interfaces/gtk/gtkproc.inc patching file interfaces/gtk/gtklistsl.inc Hunk #2 FAILED at 211. Hunk #3 FAILED at 322. Hunk #4 FAILED at 337. Hunk #5 FAILED at 359. Hunk #6 FAILED at 373. Hunk #7 FAILED at 411. Hunk #8 succeeded at 898 with fuzz 2 (offset 6 lines). 6 out of 8 hunks FAILED -- saving rejects to file interfaces/gtk/gtklistsl.inc.rej patching file interfaces/gtk/gtkwinapi.inc Hunk #1 FAILED at 2795. Hunk #2 succeeded at 7986 (offset 4 lines). 1 out of 2 hunks FAILED -- saving rejects to file interfaces/gtk/gtkwinapi.inc.rej patching file interfaces/gtk/gtkcallback.inc Hunk #1 FAILED at 19. Hunk #2 FAILED at 139. Hunk #3 FAILED at 190. Hunk #4 FAILED at 265. Hunk #5 FAILED at 282. Hunk #6 FAILED at 297. Hunk #7 FAILED at 323. Hunk #8 FAILED at 349. Hunk #9 FAILED at 365. Hunk #10 succeeded at 415 (offset 20 lines). Hunk #12 succeeded at 464 (offset 20 lines). Hunk #14 succeeded at 497 (offset 20 lines). Hunk #16 succeeded at 680 (offset 20 lines). Hunk #18 succeeded at 740 (offset 20 lines). Hunk #20 succeeded at 809 (offset 20 lines). Hunk #22 succeeded at 855 (offset 20 lines). Hunk #24 FAILED at 3089. Hunk #25 FAILED at 3100. 11 out of 25 hunks FAILED -- saving rejects to file interfaces/gtk/gtkcallback.inc.rej patching file interfaces/gtk/gtkobject.inc Hunk #2 FAILED at 1299. Hunk #3 FAILED at 3985. Hunk #4 FAILED at 4231. Hunk #5 FAILED at 6966. Hunk #6 FAILED at 7002. 5 out of 6 hunks FAILED -- saving rejects to file interfaces/gtk/gtkobject.inc.rej patching file interfaces/gtk/gtkproc.pp Reversed (or previously applied) patch detected! Assume -R? [n] BTW: never use writeln. > I have one more patch (tComboBox grab capture and not release them, but > I must stopping without finish this changes) Mattias _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] patch fo tLabel
On Sat, 18 Mar 2006 16:04:12 +0100 darekM <[EMAIL PROTECTED]> wrote: >[...] > >> Index: include/customlabel.inc > >> === > >> --- include/customlabel.inc(wersja 8956) > >> +++ include/customlabel.inc(kopia robocza) > >> @@ -39,7 +39,8 @@ > >> R := Rect(0,0, Width, Height); > >> OldFont:=SelectObject(DC, Font.Handle); > >> Flags:=DT_CalcRect; > >> -if WordWrap then inc(Flags,DT_WordBreak); > >> +if WordWrap then inc(Flags,DT_WordBreak) > >> +else inc(Flags,DT_SingleLine); > >> > > > > From > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcefonts/html/cecondrawtext.asp: > > > > DT_SINGLELINE Displays text on a single line only. Carriage > > returns and linefeeds do not break the line. > > > > Setting DT_SINGLELINE would prohibit to use custom line breaks. > > > if WordWrap=false then label should be in one line (eq. singleline), > calculate rectangle should care about it, > when not DT_SINGLELINE include, draw text is use more complicated part. > tLabel in most cases is single line > We have three cases: > 1. single line, > 2. multiple line divide by carriage return > 3. multiple line divide by carriage return and anywhere - when is not > insufficient place > > in tLabel we have only WordWrap property, for me its not the same like > dt_wordWrap only differ from single and multiple line, > tLabel must not difference case 2 and 3, in most cases is the same, only > cases 1 and 3 Why should TLabel ignore user's line breaks when WordWrap=false? Do you think, it is this too complicated for the widgetsets? Mattias _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] patch fo tLabel
Mattias Gaertner napisał(a): On Sat, 18 Mar 2006 13:35:51 +0100 darekm <[EMAIL PROTECTED]> wrote: Mattias Gaertner wrote: On Tue, 14 Mar 2006 18:21:32 +0100 darekm <[EMAIL PROTECTED]> wrote: tLabel should care about WordWrap property attached patch repair it Thanks. Applied. Mattias Thanks but I find new item: Index: include/customlabel.inc === --- include/customlabel.inc(wersja 8956) +++ include/customlabel.inc(kopia robocza) @@ -39,7 +39,8 @@ R := Rect(0,0, Width, Height); OldFont:=SelectObject(DC, Font.Handle); Flags:=DT_CalcRect; -if WordWrap then inc(Flags,DT_WordBreak); +if WordWrap then inc(Flags,DT_WordBreak) +else inc(Flags,DT_SingleLine); From http://msdn.microsoft.com/library/default.asp?url=""> DT_SINGLELINE Displays text on a single line only. Carriage returns and linefeeds do not break the line. Setting DT_SINGLELINE would prohibit to use custom line breaks. if WordWrap=false then label should be in one line (eq. singleline), calculate rectangle should care about it, when not DT_SINGLELINE include, draw text is use more complicated part. tLabel in most cases is single line We have three cases: 1. single line, 2. multiple line divide by carriage return 3. multiple line divide by carriage return and anywhere - when is not insufficient place in tLabel we have only WordWrap property, for me its not the same like dt_wordWrap only differ from single and multiple line, tLabel must not difference case 2 and 3, in most cases is the same, only cases 1 and 3 Darek DrawText(DC, PChar(Caption), Length(Caption), R, Flags); SelectObject(DC, OldFont); // add one to be able to display disabled label Darek PS. What's about my previously patch (tComboBox) now I have much more investigation: Applied. I changed the NumLines>1 with a DT_CALCRECT<>0. [...] Mattias _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] patch fo tLabel
On Sat, 18 Mar 2006 13:35:51 +0100 darekm <[EMAIL PROTECTED]> wrote: > Mattias Gaertner wrote: > > >On Tue, 14 Mar 2006 18:21:32 +0100 > >darekm <[EMAIL PROTECTED]> wrote: > > > > > > > >>tLabel should care about WordWrap property > >> > >>attached patch repair it > >> > >> > > > >Thanks. Applied. > > > >Mattias > > > > > > > > > Thanks > > but I find new item: > > > Index: include/customlabel.inc > === > --- include/customlabel.inc(wersja 8956) > +++ include/customlabel.inc(kopia robocza) > @@ -39,7 +39,8 @@ > R := Rect(0,0, Width, Height); > OldFont:=SelectObject(DC, Font.Handle); > Flags:=DT_CalcRect; > -if WordWrap then inc(Flags,DT_WordBreak); > +if WordWrap then inc(Flags,DT_WordBreak) > +else inc(Flags,DT_SingleLine); From http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcefonts/html/cecondrawtext.asp: DT_SINGLELINE Displays text on a single line only. Carriage returns and linefeeds do not break the line. Setting DT_SINGLELINE would prohibit to use custom line breaks. > DrawText(DC, PChar(Caption), Length(Caption), R, Flags); > SelectObject(DC, OldFont); > // add one to be able to display disabled label > > > > Darek > PS. What's about my previously patch (tComboBox) > now I have much more investigation: Applied. I changed the NumLines>1 with a DT_CALCRECT<>0. >[...] Mattias _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] patch fo tLabel
Mattias Gaertner wrote: On Tue, 14 Mar 2006 18:21:32 +0100 darekm <[EMAIL PROTECTED]> wrote: tLabel should care about WordWrap property attached patch repair it Thanks. Applied. Mattias Thanks but I find new item: Index: include/customlabel.inc === --- include/customlabel.inc(wersja 8956) +++ include/customlabel.inc(kopia robocza) @@ -39,7 +39,8 @@ R := Rect(0,0, Width, Height); OldFont:=SelectObject(DC, Font.Handle); Flags:=DT_CalcRect; -if WordWrap then inc(Flags,DT_WordBreak); +if WordWrap then inc(Flags,DT_WordBreak) +else inc(Flags,DT_SingleLine); DrawText(DC, PChar(Caption), Length(Caption), R, Flags); SelectObject(DC, OldFont); // add one to be able to display disabled label Darek PS. What's about my previously patch (tComboBox) now I have much more investigation: 1. for tSpeedButton: caption is paint in improper place (row for caption 'zoom' and 'insert' is not the same for fonts other than defaults 2. added some improvements for debugging 3. repairedfunction FindLineEnd(LineStart: integer) for text in UTF8 4. for tComboBox select signal is fired only one time per click Can can somebody test it. I have one more patch (tComboBox grab capture and not release them, but I must stopping without finish this changes) Index: interfaces/gtk/gtkproc.inc === --- interfaces/gtk/gtkproc.inc (wersja 8956) +++ interfaces/gtk/gtkproc.inc (kopia robocza) @@ -1042,6 +1042,7 @@ var PS : PPaintStruct; begin + writeln('gtkpaintmessagetoPaint'); Result.Msg:=LM_PAINT; New(PS); PS^.hDC:=0; @@ -3443,11 +3444,12 @@ function DeliverMessage(const Target: Pointer; var AMessage): Integer; begin if Target=nil then DebugLn('[DeliverMessage] Target = nil'); - {$IFDEF VerboseDeliverMessage} - DebugLn('DeliverMessage ',DbgS(Target), + {.$IFDEF VerboseDeliverMessage} + if TLMessage(AMessage).Msg<>LM_MOUSEMOVE then +DebugLn('DeliverMessage ',DbgS(Target), ' ',TComponent(Target).Name,':',TObject(Target).ClassName, ' Message=',GetMessageName(TLMessage(AMessage).Msg)); - {$ENDIF} + {.$ENDIF} if (TLMessage(AMessage).Msg=LM_PAINT) or (TLMessage(AMessage).Msg=LM_INTERNALPAINT) or (TLMessage(AMessage).Msg=LM_GtkPaint) then @@ -4415,15 +4417,16 @@ if OldMouseCaptureWidget<>CurMouseCaptureWidget then begin // the mouse grab changed // -> this means the gtk itself has changed the mouse grab -{$IFDEF VerboseMouseCapture} +{.$IFDEF VerboseMouseCapture} DebugLn('UpdateMouseCaptureControl Capture changed from ', '[',GetWidgetDebugReport(OldMouseCaptureWidget),']', ' to [',GetWidgetDebugReport(CurMouseCaptureWidget),']'); -{$ENDIF} +{.$ENDIF} // notify the new capture control MouseCaptureWidget:=CurMouseCaptureWidget; MouseCaptureType:=mctGTK; +exit; if MouseCaptureWidget<>nil then begin // the MouseCaptureWidget is probably not a main widget SendMessage(HWnd(MouseCaptureWidget), LM_CAPTURECHANGED, 0, @@ -4445,9 +4448,9 @@ CaptureWidget: PGtkWidget; NowIndex: Cardinal; begin - {$IFDEF VerboseMouseCapture} + {.$IFDEF VerboseMouseCapture} DebugLn('CaptureMouseForWidget START ',GetWidgetDebugReport(Widget)); - {$ENDIF} + {.$ENDIF} if not (Owner in [mctGTKIntf,mctLCL]) then exit; // not every widget can capture the mouse CaptureWidget:=GetDefaultMouseCaptureWidget(Widget); Index: interfaces/gtk/gtklistsl.inc === --- interfaces/gtk/gtklistsl.inc(wersja 8956) +++ interfaces/gtk/gtklistsl.inc(kopia robocza) @@ -19,6 +19,8 @@ * } +{.$DEFINE EventTrace} + const GtkListItemGtkListTag = 'GtkList'; GtkListItemLCLListTag = 'LCLList'; @@ -209,6 +211,9 @@ //ItemIndex: LongInt; Mess: TLMessage; begin + {$IFDEF EventTrace} + Debugln('gtkListItemSelectAfterCB'); + {$ENDIF} // get context GtkList:=PGtkList(gtk_object_get_data(PGtkObject(Data),GtkListItemGtkListTag)); if GtkList=nil then @@ -317,6 +322,9 @@ ListItem: PGtkListItem; begin UpdateItemCache; + {$IFDEF EventTrace} + Debugln( 'connect ',strings[index]); + {$ENDIF} ListItem:=FCachedItems[Index]; ConnectItemCallbacks(ListItem); end; @@ -329,6 +337,9 @@ var ChildWidget: Pointer; begin + {$IFDEF EventTrace} + Debugln('connect itemCallback'); + {$ENDIF} gtk_object_set_data(PGtkObject(li),GtkListItemLCLListTag,Self); gtk_object_set_data(PGtkObject(li),GtkListItemGtkListTag,FGtkList); //DebugLn('TGtkListStringList.ConnectItemCallbacks Self=',DbgS(Self), @@ -348,10 +359,6 @@ g_signal_connect_after(G_OBJECT(ChildWidget), 'toggled', G_CALLBACK(@gtkListItemToggledCB), li); end;
Re: [lazarus] patch fo tLabel
On Tue, 14 Mar 2006 18:21:32 +0100 darekm <[EMAIL PROTECTED]> wrote: > tLabel should care about WordWrap property > > attached patch repair it Thanks. Applied. Mattias _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
[lazarus] patch fo tLabel
tLabel should care about WordWrap property attached patch repair it Darek Index: include/customlabel.inc === --- include/customlabel.inc (wersja 8935) +++ include/customlabel.inc (kopia robocza) @@ -365,7 +365,11 @@ FillChar(TR,SizeOf(TR),0); With TR do begin Alignment := Self.Alignment; - WordBreak := True; + if wordWrap then begin +WordBreak := True; + end else begin +SingleLine:=true; + end; Clipping := True; ShowPrefix := ShowAccelChar; SystemFont:=false;