ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Pan

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
John Posted - Mar 18 2012 : 14:44:23
Hello

I have a SpeedButton that sets ImageEnView1.MouseInteract := [miScroll]. I would like to enable this SpeedButton only when scrolling is a viable alternative, i.e. when there is either a visible horizontal and/or vertical scroll bar associated with ImageEnView1.

To accomplish the above I need to be able to determine (via code) whether the horizontal and/or vertical scroll bars are visible. Unfortunately, I have been unable to find such a property/function. Does such a property/function exist?

Suggestions?

TIA

John
3   L A T E S T    R E P L I E S    (Newest First)
fab Posted - Mar 20 2012 : 00:28:40
John,
unfortunately Delphi defines OBJID_HSCROLL = $FFFFFFFA, but GetScrollBarInfo is defined as:
Function GetScrollBarInfo(hwnd: HWND; idObject: Longint; var psbi: TScrollBarInfo): BOOL; stdcall;

So assigning $FFFFFFFA to Longint raises this warning. You could disable these warnings (for this piece of code) setting:

{$WARNINGS OFF} GetScrollBarInfo(ImageEnView1.Handle, OBJID_HSCROLL, sbi); {$WARNINGS ON}

and

{$WARNINGS OFF} GetScrollBarInfo(ImageEnView1.Handle, OBJID_VSCROLL, sbi); {$WARNINGS ON}

This should not happen with newer versions of Delphi.
John Posted - Mar 19 2012 : 13:30:02
Fabrizio

Thanks.

I have placed the code as a private procedure in two different forms, each having an ImageEnView1 component. Both ImageEnView1 components have the same properties set and the code works correctly in both forms. However, I get the following compiler error in one of the two forms. [DCC Warning] ViewXrays.pas(1118): W1012 Constant expression violates subrange bounds

Can you suggest why I would get this compiler error from only one of the two forms?

TIA

John
fab Posted - Mar 19 2012 : 00:25:55
Hello,
this code could help you:
var
  sbi:TSCROLLBARINFO;
begin
  sbi.cbSize := sizeof(TSCROLLBARINFO);

  // check for horizontal scrollbar
  GetScrollBarInfo(ImageEnView1.Handle, OBJID_HSCROLL, sbi);
  if (sbi.rgstate[0] and STATE_SYSTEM_INVISIBLE) = 0 then
    ShowMessage('Horizontal scrollbar visible');

  // check for vertical scrollbar
  GetScrollBarInfo(ImageEnView1.Handle, OBJID_VSCROLL, sbi);
  if (sbi.rgstate[0] and STATE_SYSTEM_INVISIBLE) = 0 then
    ShowMessage('Vertical scrollbar visible');

end;