JXJ
22-02-2009, 03:11:31
hola..
estoy haciendo unos cambios al Innosetup
especificamente al IDE compilador.
pasarlo de la version 1.1 de SynEdit por una de las mas actuales.
uso el synedit 201b
el problema esta en el uso de Tpoint y BufferCoord.
no entiendo como convertir el codigo.
el codigo original es el que dice Orginal y lo demas son los cambio que le he hecho.
es la unidad CompForm.pas del proyecto Compil32
procedure TCompileForm.MemoWndProc(var Message: TMessage);
function GetCodeVariableDebugEntryFromLineCol(Line, Col: Integer):
PVariableDebugEntry;
var
I: Integer;
begin
Result := nil;
for I := 0 to FVariableDebugEntriesCount - 1 do
begin
if (FVariableDebugEntries[I].LineNumber = Line) and
(FVariableDebugEntries[I].Col = Col)
then
begin
Result := @FVariableDebugEntries[I];
Break;
end;
end;
end;
var
Line, Col, I, J: Integer;
P, P2: TPoint;{original}
// P, P2: TDisplayCoord;//lo agrege yo para ver si aqui era el problema
// P, P2: TBufferCoord;//lo agrege yo para ver si aqui era el problema
S, Output: string;
DebugEntry: PVariableDebugEntry;
begin
if (Message.Msg = CM_HINTSHOW) and (FDebugClientWnd <> 0) then
begin
with TCMHintShow(Message).HintInfo^ do
begin
//este es el que no logro convertir. no compila.
// P := Memo.PixelsToRowColumn(Point(CursorPos.X - Memo.CharWidth div 2, CursorPos.Y)); {Original}
// pixeles a fila columna
//da error de
//[Error] CompForm.pas(1863): Incompatible types: 'Integer' and 'TPoint'
P := Memo.PixelsToRowColumn(Point(CursorPos.X - Memo.CharWidth div 2, CursorPos.Y));
if P.Y <= Memo.Lines.Count then
begin
Line := P.Y;
Col := P.X;
S := Memo.Lines[Line - 1];
if (Col >= 1) and (Col <= Length(S)) and (S[Col] in ['a'..'z', 'A'..'Z',
'0'..'9', '_'])
then
begin
while (Col > 1) and (S[Col - 1] in ['a'..'z', 'A'..'Z', '0'..'9', '_'])
do
Dec(Col);
DebugEntry := GetCodeVariableDebugEntryFromLineCol(Line, Col);
if DebugEntry <> nil then
begin
J := Col;
while S[J] in ['a'..'z', 'A'..'Z', '0'..'9', '_'] do
Inc(J);
case EvaluateVariableEntry(DebugEntry, Output) of
1: HintStr := Output;
2: HintStr := Output;
else
HintStr := 'Unknown error';
end;
// revisa
// P2 := Memo.RowColumnToPixels(Point(Col, P.Y)); {Original}
P2 := Memo.RowColumnToPixels(DisplayCoord(Col, P.Y));
CursorRect := Bounds(P2.X, P2.Y, (J - Col) * Memo.CharWidth,
Memo.LineHeight);
HideTimeout := High(Integer); // infinite
Exit;
end;
end;
I := 1;
while I <= Length(S) do
begin
if S[I] = '{' then
begin
if (I < Length(S)) and (S[I + 1] = '{') then
{ Skip '{{' }
Inc(I, 2)
else
begin
J := SkipPastConst(S, I);
if J = 0 then // unclosed constant?
Break;
if (P.X >= I) and (P.X < J) then
begin
HintStr := Copy(S, I, J - I);
case EvaluateConstant(HintStr, Output) of
1: HintStr := HintStr + ' = "' + Output + '"';
2: HintStr := HintStr + ' = ' + Output;
else
HintStr := HintStr + ' = Unknown error';
end;
// revisa
// P2 := Memo.RowColumnToPixels(Point(I, P.Y)); {Original}
P2 := Memo.RowColumnToPixels(DisplayCoord(I, P.Y));
CursorRect := Bounds(P2.X, P2.Y, (J - I) * Memo.CharWidth,
Memo.LineHeight);
HideTimeout := High(Integer); // infinite
Break;
end;
I := J;
end;
end
else
begin
if S[I] in ConstLeadBytes^ then
Inc(I);
Inc(I);
end;
end;
end;
end;
end
else
Memo.WndProc(Message);
end;
fgracias por su ayuda
[/delphi]
estoy haciendo unos cambios al Innosetup
especificamente al IDE compilador.
pasarlo de la version 1.1 de SynEdit por una de las mas actuales.
uso el synedit 201b
el problema esta en el uso de Tpoint y BufferCoord.
no entiendo como convertir el codigo.
el codigo original es el que dice Orginal y lo demas son los cambio que le he hecho.
es la unidad CompForm.pas del proyecto Compil32
procedure TCompileForm.MemoWndProc(var Message: TMessage);
function GetCodeVariableDebugEntryFromLineCol(Line, Col: Integer):
PVariableDebugEntry;
var
I: Integer;
begin
Result := nil;
for I := 0 to FVariableDebugEntriesCount - 1 do
begin
if (FVariableDebugEntries[I].LineNumber = Line) and
(FVariableDebugEntries[I].Col = Col)
then
begin
Result := @FVariableDebugEntries[I];
Break;
end;
end;
end;
var
Line, Col, I, J: Integer;
P, P2: TPoint;{original}
// P, P2: TDisplayCoord;//lo agrege yo para ver si aqui era el problema
// P, P2: TBufferCoord;//lo agrege yo para ver si aqui era el problema
S, Output: string;
DebugEntry: PVariableDebugEntry;
begin
if (Message.Msg = CM_HINTSHOW) and (FDebugClientWnd <> 0) then
begin
with TCMHintShow(Message).HintInfo^ do
begin
//este es el que no logro convertir. no compila.
// P := Memo.PixelsToRowColumn(Point(CursorPos.X - Memo.CharWidth div 2, CursorPos.Y)); {Original}
// pixeles a fila columna
//da error de
//[Error] CompForm.pas(1863): Incompatible types: 'Integer' and 'TPoint'
P := Memo.PixelsToRowColumn(Point(CursorPos.X - Memo.CharWidth div 2, CursorPos.Y));
if P.Y <= Memo.Lines.Count then
begin
Line := P.Y;
Col := P.X;
S := Memo.Lines[Line - 1];
if (Col >= 1) and (Col <= Length(S)) and (S[Col] in ['a'..'z', 'A'..'Z',
'0'..'9', '_'])
then
begin
while (Col > 1) and (S[Col - 1] in ['a'..'z', 'A'..'Z', '0'..'9', '_'])
do
Dec(Col);
DebugEntry := GetCodeVariableDebugEntryFromLineCol(Line, Col);
if DebugEntry <> nil then
begin
J := Col;
while S[J] in ['a'..'z', 'A'..'Z', '0'..'9', '_'] do
Inc(J);
case EvaluateVariableEntry(DebugEntry, Output) of
1: HintStr := Output;
2: HintStr := Output;
else
HintStr := 'Unknown error';
end;
// revisa
// P2 := Memo.RowColumnToPixels(Point(Col, P.Y)); {Original}
P2 := Memo.RowColumnToPixels(DisplayCoord(Col, P.Y));
CursorRect := Bounds(P2.X, P2.Y, (J - Col) * Memo.CharWidth,
Memo.LineHeight);
HideTimeout := High(Integer); // infinite
Exit;
end;
end;
I := 1;
while I <= Length(S) do
begin
if S[I] = '{' then
begin
if (I < Length(S)) and (S[I + 1] = '{') then
{ Skip '{{' }
Inc(I, 2)
else
begin
J := SkipPastConst(S, I);
if J = 0 then // unclosed constant?
Break;
if (P.X >= I) and (P.X < J) then
begin
HintStr := Copy(S, I, J - I);
case EvaluateConstant(HintStr, Output) of
1: HintStr := HintStr + ' = "' + Output + '"';
2: HintStr := HintStr + ' = ' + Output;
else
HintStr := HintStr + ' = Unknown error';
end;
// revisa
// P2 := Memo.RowColumnToPixels(Point(I, P.Y)); {Original}
P2 := Memo.RowColumnToPixels(DisplayCoord(I, P.Y));
CursorRect := Bounds(P2.X, P2.Y, (J - I) * Memo.CharWidth,
Memo.LineHeight);
HideTimeout := High(Integer); // infinite
Break;
end;
I := J;
end;
end
else
begin
if S[I] in ConstLeadBytes^ then
Inc(I);
Inc(I);
end;
end;
end;
end;
end
else
Memo.WndProc(Message);
end;
fgracias por su ayuda
[/delphi]