Transparency and ClipControls

OK here goes:

  I have an OCX component (VisualWriter by Visual Components Inc. as it happens) which has a property BackStyle which can be set to transparent. The problem is that the component seems to have been written very much with Visual Basic in mind. When I try to set the BackStyle property to transparent I receive a warning telling me to set the Object's container's ClipControls property. This ClipControls property is presumably a VB property and I assume that it is simply an implementation of some Windows API functionality.
  What I need to know is how to replecate this VB ClipControls property within Delphi, such that I can have my transparent component.

  Steven.
LVL 4
StevenBAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ywoedtaCommented:
hrmmm - i have plenty of experience with the visual writer in VB, but have not yet used it in Delphi.... what is you planned implementation of the writer?  (I would heavily dissaude you from usuing the component - it is very buggy and not worth nearly the $$ it costs.... for instance, the only thing keeping ym current project from leaving is the fact that visualwriter has not yet fixed a pretty serious memory leak in the writer, causing my program to suck windows into oblivion.  They even admit to the error, but won't fix it "until the next version...")  If you still want to use it, then i'd say to look around the API for clip controls and similar functions and messages.  I'll do some more research on this and get back to you.
0
StevenBAuthor Commented:
 Thanks for the words. The reason I'm investigating the VisualWriter is that it seems to be one of the few text editors that scales its fonts correctly in different zoom modes. This is crucial as several of the other I've looked at actually alter the word wrapping at different zooms as the absolute font sizes change, obviously useless. I also require a transparent control and the visual writer seems to at least offer that potential.
  Do you know if the companies other products are equally problem prone? I'm also investigating First Impressions and Formula One. Any more advice and suggestions would be most welcome. If you were to recomend an alternative text editor then what would it be?

  Cheers, Steven.
0
ywoedtaCommented:
well, here is my take on the visualwriter situation.... the VisualWriter component was designed to be the main text editing area on a word processing program.  It work pretty well at this, but my company wanted what you describe..  a rich text editor with transparent capabilities that we would use as a large text box.  It DOES NOT function well as this...  if you are looking for a text box style control that would be used more than once per form, then i'd say stay away from the VisualWriter.  If you're making something similar to a word processor / text editor, then go ahead and test away....  As per other components, have you checked out the Delphi Depot and the Deplhi SuperPage for similar, less expensive controls?  (oh - i am going to poke around the API help for getting the visualwriter to be transparent today.... if i figure anything out, then i'll take those points off of your hands for this question ;] )
0
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

StevenBAuthor Commented:
 If you can find out how to effect transparency then you're more than welcome to the points. Keep in touch through these comments, any tips, advice or comments are appreciated.

  Steven.
0
fsanchezCommented:
Hello, Steven. I don't have that component, so I'm not sure if this will work. It seems to me that the property ClipControls is really the CS_CLIPCHILDREN flag, or perhaps CS_CLIPSIBLINGS, or may both. This flags are used in the parameter dwStyle of the CreateWindow function of the Windows API. To change this parameter in Delphi you have (sorry, bad news) to derive your own control from the type of control that you use as container of the VisualWriter component and redefine one method. It's something like this:

...
procedure TXXX.CreateParams(var Params: TCreateParams); override;

...

procedure TXXX.CreateParams(var Params: TCreateParams);
begin
  inherited CreateParams(Params);

  with Params do
  begin
    Style := Style and ~WS_CLIPCHILDREN;
  end;
end;

In this example I have eliminated the flag WS_CLIPCHILDREN. If this doesn't work, you should try these too:
    Style := Style and ~WS_CLIPSIBLINGS;
    Style := Style and ~(WS_CLIPCHILDREN or WS_CLIPSIBLINGS);

Good luck.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
StevenBAuthor Commented:
 OK. I've just got back off holiday and I've got a lot of catching up to do, so bear with me and I will get round to checking this. Cheers for your interest.

  Steven.
0
fsanchezCommented:
Sorry, I have found a mistake. Please replace '~' with 'not'.
0
InteqamCommented:
thanks guys ,

i will appreicate if somebody told me how to set this property (ClipControls )( and make it work ) at run time in a VB project.
0
StevenBAuthor Commented:
 Whoah, I thought this thread was long dead :o)


  Sorry, Inteqam, can't help you myself I'm afraid. I never did get to the bottom of this problem, in the end I went for a completely different approach.

  Steven
0
InteqamCommented:
thanks alot

i searched for CS_CLIPCHILDREN  along time to find that it is WS_CLIPCHILDREN

:o)

i found it and it worked just fine , thank you again .

but can i ask one last question ,

what are static controls , other than option button and check box?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.