Forum > CustomDrawn
[SOLVED] class function TCDWSButton.GetText doesn't return a result
(1/1)
lagprogramming:
lcl/interfaces/customdrawn/customdrawnwsstdctrls.pas contains the following function. It can be noticed that it doesn't return a result.
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---class function TCDWSButton.GetText(const AWinControl: TWinControl; var AText: String): Boolean;var lCDWinControl: TCDWinControl;begin lCDWinControl := TCDWinControl(AWinControl.Handle); if lCDWinControl.CDControl = nil then Exit; AText := TCDIntfButton(lCDWinControl.CDControl).Caption;end;
New code mimics result assignment of class function TCDWSCustomEdit.GetText
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---class function TCDWSButton.GetText(const AWinControl: TWinControl; var AText: String): Boolean;var lCDWinControl: TCDWinControl;begin Result := False; lCDWinControl := TCDWinControl(AWinControl.Handle); if lCDWinControl.CDControl = nil then Exit; AText := TCDIntfButton(lCDWinControl.CDControl).Caption; Result := True;end;
Bart:
Please report in the bugtracker and attach your patch (as a proper diff).
Bart
lagprogramming:
Here is a patch
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---diff --git a/lcl/interfaces/customdrawn/customdrawnwsstdctrls.pas b/lcl/interfaces/customdrawn/customdrawnwsstdctrls.pasindex 795ca36d3e..1a90af04e9 100644--- a/lcl/interfaces/customdrawn/customdrawnwsstdctrls.pas+++ b/lcl/interfaces/customdrawn/customdrawnwsstdctrls.pas@@ -1704,9 +1704,11 @@ class function TCDWSButton.GetText(const AWinControl: TWinControl; var lCDWinControl: TCDWinControl; begin+ Result := False; lCDWinControl := TCDWinControl(AWinControl.Handle); if lCDWinControl.CDControl = nil then Exit; AText := TCDIntfButton(lCDWinControl.CDControl).Caption;+ Result := True; end; class procedure TCDWSButton.SetText(const AWinControl: TWinControl;
Bart:
Please put it in the bugtracker, so it won't be forgotten.
I know next to nothing about CD widgetset.
Bart
wp:
Like Bart I have no experience with customdrawn WS, but since your solution is obvious and straightforward, I committed it. But please, report issues in the bugtracker where it is easier for us to trace regressions and side-effects.
Navigation
[0] Message Index