Recent

Author Topic: Questions  (Read 104874 times)

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: Questions
« Reply #135 on: January 09, 2011, 02:27:50 pm »
KeyDown proc reacts just once.
Then there seems to be bug with Lazarus svn, i may have to update again though... Make this test app and see if numbers are scrolling when key is pressed:
Code: [Select]
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState
  );
begin
  caption:='keydown '+inttostr(random(10));
end;

procedure TForm1.FormKeyPress(Sender: TObject; var Key: char);
begin
  // Keypress should be triggering multiple times, comment out to test too
  //caption:='keypress '+inttostr(random(10));
end;

procedure TForm1.FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
  caption:='keyup '+inttostr(random(10));
end;

Edit: Actually Delphi does this too so its not a bug. You may have to save the key state in variable, either an array or just your specific key.

Code: [Select]
var keys: array[0..255] of boolean;

onKeyDown:
  if not keys[key] then begin
    // Insert here code that happens only once
    if key=13 then begin // Return key pressed

    end;
  end;
  keys[key]:=true;

onKeyUp:
  keys[key]:=false;
« Last Edit: January 09, 2011, 02:47:33 pm by User137 »

gyts

  • Jr. Member
  • **
  • Posts: 96
Re: Questions
« Reply #136 on: February 20, 2011, 07:52:32 pm »
Hi everyone again ;)

How to apply/address/turn in/call to this
Code: [Select]
procedure TForm1.S15t1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); procedure from any other procedure?
When I'm trying to do this:
Code: [Select]
S15t1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); I get: http://img88.imageshack.us/i/20974166.png/

Edit: Don't need it anymore
« Last Edit: February 21, 2011, 11:15:32 pm by gyts »

gyts

  • Jr. Member
  • **
  • Posts: 96
Re: Questions
« Reply #137 on: February 21, 2011, 11:27:28 pm »
Is there any way to make TShapes transparent?

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: Questions
« Reply #138 on: February 21, 2011, 11:35:26 pm »
Yes, setting Brush.Style as bsClear.

gyts

  • Jr. Member
  • **
  • Posts: 96
Re: Questions
« Reply #139 on: February 22, 2011, 09:47:17 am »
And x% of transparency is possible?

gyts

  • Jr. Member
  • **
  • Posts: 96
Re: Questions
« Reply #140 on: February 23, 2011, 10:32:02 pm »
When I add a new TButton in form it is shown as in winxp - with round corners, but when the program is started, buttons is shown as in win98 - with sharp corners.

Please help.

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2512
Re: Questions
« Reply #141 on: February 23, 2011, 10:43:50 pm »
check project options -> manifest
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

gyts

  • Jr. Member
  • **
  • Posts: 96
Re: Questions
« Reply #142 on: March 06, 2011, 12:49:23 pm »
How to use this within procedures?
http://img203.imageshack.us/i/56020760.png/

Blaazen

  • Hero Member
  • *****
  • Posts: 2912
  • POKE 54296,15
    • Eye-Candy Controls
Re: Questions
« Reply #143 on: March 06, 2011, 01:23:37 pm »
I know only one:

SetOrder(TopMost: Boolean);
Code: [Select]
with Button1 do SetZOrder(True);  //this will move Button1 to the topUse it with "with" statement.
It works here on Qt.
Lazarus 2.1.0 r63881 FPC 3.3.1 r40507 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

DirkS

  • Sr. Member
  • ****
  • Posts: 251
Re: Questions
« Reply #144 on: March 06, 2011, 01:27:14 pm »
How to use this within procedures?
http://img203.imageshack.us/i/56020760.png/
See TControl.SendToBack, .BringToFront, .SetZOrder

Gr.
Dirk.

tigers1904

  • Newbie
  • Posts: 1
Re: Questions
« Reply #145 on: April 18, 2011, 04:55:09 pm »
how to fill a box?

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: Questions
« Reply #146 on: April 18, 2011, 04:59:27 pm »
You should set Brush.Color before drawing the box, then it will be filled with that color.

 

TinyPortal © 2005-2018