Jump to content


Photo

NxEdit OnGlyphClick Not Working


  • Please log in to reply
9 replies to this topic

#1 deonvn

deonvn

    Senior Member

  • Honorable Members
  • PipPip
  • 313 posts

Posted 16 August 2007 - 12:04 PM

Hi Boki

The title says it all. NxEdit.OnGlyphClick does nothing.

Thanks
Deon

#2 deonvn

deonvn

    Senior Member

  • Honorable Members
  • PipPip
  • 313 posts

Posted 17 August 2007 - 01:03 PM

Hi Boki

Can you look at this when you get time? (it's not urgent - so "whenever" will be fine).

I'm trying to make a search/filter edit like the one in ThunderBird to do searches of set filters on specific columns.

(See attached screenshots)

NxEdit is already very close smile.gif - I just need to pop up a menu when the glyph is clicked.

For the life of me, I cannot get NxEdit to respond to MouseMove events when the mouse is in the glyph or preview areas sad.gif

I would appreciate it if you can check what the problem is..

Thanks in advance.
Deon

Attached Files



#3 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 17 August 2007 - 01:27 PM

Hello Deon,

I will add now OnGlyphClick. Don't know how it is detached blink.gif

Why you need MouseMove in this situation? smile.gif

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 17 August 2007 - 01:34 PM

Update: I have fix OnGlyphClick.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#5 deonvn

deonvn

    Senior Member

  • Honorable Members
  • PipPip
  • 313 posts

Posted 17 August 2007 - 01:45 PM

Great - thanks smile.gif

Can you send the new NxEdit.pas to my e-mail?

PS: I don't need MouseMove - I was justing using it to try and find out why the glyph is not responding to mouse events.

Thanks again
Deon

#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 17 August 2007 - 01:48 PM

Hello Deon,

Add next procedure:

CODE
TNxEditInfo = class...
...
protected
  procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
...

procedure TNxEditInfo.MouseDown(Button: TMouseButton; Shift: TShiftState;
  X, Y: Integer);
begin
  inherited;
  if Assigned(FOwner.FGlyph) and not FOwner.FGlyph.Empty
    and PtInRect(Rect(0, 0, FOwner.FGlyph.Width, Height), Point(X, Y)) then
  begin
    FOwner.DoGlyphClick;
  end;
end;


and delete same code from TNxCustomEdit.MouseDown.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#7 deonvn

deonvn

    Senior Member

  • Honorable Members
  • PipPip
  • 313 posts

Posted 17 August 2007 - 02:07 PM

Nope - did that - still doesn't work sad.gif

#8 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 17 August 2007 - 02:17 PM

Hello Deon,

Maybe adding override at end of procedure in interface section may help (I have skip to include it):

procedure MouseDown(Button: TMouseButton; Shift: TShiftState; override;

regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#9 deonvn

deonvn

    Senior Member

  • Honorable Members
  • PipPip
  • 313 posts

Posted 17 August 2007 - 02:23 PM

That's it - it's working fine now smile.gif

PS: I think the following two procedure need to check GlyphWidth and Indent for preview?

CODE
procedure TNxEdit.MouseMove(Shift: TShiftState; X, Y: Integer);
begin
  inherited;
  if X <= 2 then Cursor := crReversedArrow else Cursor := crDefault;
end;

procedure TNxEdit.MouseDown(Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  inherited;
  if X <= 2 then SelectAll;
end;


Thanks again.
Deon

#10 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,289 posts
  • Gender:Male

Posted 17 August 2007 - 02:36 PM

Hello Deon,

I have fix it. Add one new procedure inside protected of TNxCustomEdit.

CODE
function TNxCustomEdit.GetEditLeft: Integer;
begin
  if FEditInfo.Visible then
  begin
    Result := FEditInfo.Left + FEditInfo.Width;
  end else Result := 0;
end;


then code in both mouse events change with

CODE
if X <= 2


into

CODE
if X <= GetEditLeft + 2


Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users