http://www.andreanolanusse.com/pt/enviando-informacoes-de-depuracao-para-o-event-log-do-delphi/
quarta-feira, 22 de julho de 2020
Log
Veja o link
http://www.andreanolanusse.com/pt/enviando-informacoes-de-depuracao-para-o-event-log-do-delphi/
http://www.andreanolanusse.com/pt/enviando-informacoes-de-depuracao-para-o-event-log-do-delphi/
segunda-feira, 15 de junho de 2020
criar nova instancia do delphi limpa
Criar um atalho e na linha do comando colocar
C:\Program Files (x86)\Embarcadero\Studio\20.0\bin\bds.exe"
Depois do executavel do BDS digite -R e nome da nova instancia
ex:
C:\Program Files (x86)\Embarcadero\Studio\20.0\bin\bds.exe" -R web
quarta-feira, 27 de maio de 2020
terça-feira, 26 de maio de 2020
ListView Infinito
procedure TForm2.ListView1ScrollViewChange(Sender: TObject);
var
R: TRectF;
LItem: TListViewItem;
I: Integer;
begin
if TListView(Sender).ItemCount > 0 then // Just in case...
begin
// Get the last item's Rect
R := TListView(Sender).GetItemRect(TListView(Sender).ItemCount - 1);
// Bottom?
if R.Bottom = TListView(Sender).Height then
begin
Caption := 'Reached bottom!';
for I := 21 to 40 do
begin
LItem := ListView1.Items.Add;
LItem.Text := IntToStr(I);
end;
end
else
Caption := 'Bottom not reached yet.';
end;
end;
var
R: TRectF;
LItem: TListViewItem;
I: Integer;
begin
if TListView(Sender).ItemCount > 0 then // Just in case...
begin
// Get the last item's Rect
R := TListView(Sender).GetItemRect(TListView(Sender).ItemCount - 1);
// Bottom?
if R.Bottom = TListView(Sender).Height then
begin
Caption := 'Reached bottom!';
for I := 21 to 40 do
begin
LItem := ListView1.Items.Add;
LItem.Text := IntToStr(I);
end;
end
else
Caption := 'Bottom not reached yet.';
end;
end;
segunda-feira, 11 de maio de 2020
Mudar cor da barra de seleção DBGrid
Essa Rotina muda a Cor da Barra de Seleção de uma DBGRID.
Aqui tb está sendo alterado a Cor da Font. (Copiado do site Planeta Delphi)
procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect; Field: TField; State: TGridDrawState);
begin
if gdSelected in State then // verifica se está selecionada
DBGrid1.Canvas.Brush.Color := clYellow; // muda a cor
// da barra
// Muda a Cor da Fonte
if Table1.FieldByName('Vip_Status').AsString = 'VIP' then
DBGrid1.Canvas.Font.Color := clRed
else
DBGrid1.Canvas.Font.Color := clBlack;
DBGrid1.DefaultDrawDataCell(Rect, Field, State);
end;
Aqui tb está sendo alterado a Cor da Font. (Copiado do site Planeta Delphi)
procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect; Field: TField; State: TGridDrawState);
begin
if gdSelected in State then // verifica se está selecionada
DBGrid1.Canvas.Brush.Color := clYellow; // muda a cor
// da barra
// Muda a Cor da Fonte
if Table1.FieldByName('Vip_Status').AsString = 'VIP' then
DBGrid1.Canvas.Font.Color := clRed
else
DBGrid1.Canvas.Font.Color := clBlack;
DBGrid1.DefaultDrawDataCell(Rect, Field, State);
end;
Colocar menu popup ao lado do button
var
vPonto : TPoint;
begin
vPonto := Button1.ClientToScreen(Point(0, Button1.Height));
PopUpMenu1.Popup(vPonto.X, vPonto.Y);
vPonto : TPoint;
begin
vPonto := Button1.ClientToScreen(Point(0, Button1.Height));
PopUpMenu1.Popup(vPonto.X, vPonto.Y);
quinta-feira, 30 de abril de 2020
Enter como TAB no Delphi Firemonkey
Usar os seguintes comandos no onKeyDown do formulario
if Key = vkReturn then
begin
Key := vkTab;
KeyDown(Key, KeyChar, Shift);
end;
if Key = vkReturn then
begin
Key := vkTab;
KeyDown(Key, KeyChar, Shift);
end;
Assinar:
Postagens (Atom)