[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Transparency and ClipControls

Posted on 1997-06-03
10
Medium Priority
?
352 Views
Last Modified: 2010-04-06
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.
0
Comment
Question by:StevenB
  • 4
  • 2
  • 2
  • +1
10 Comments
 
LVL 1

Expert Comment

by:ywoedta
ID: 1336796
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
 
LVL 4

Author Comment

by:StevenB
ID: 1336797
 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
 
LVL 1

Expert Comment

by:ywoedta
ID: 1336798
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Author Comment

by:StevenB
ID: 1336799
 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
 
LVL 1

Accepted Solution

by:
fsanchez earned 510 total points
ID: 1336800
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
 
LVL 4

Author Comment

by:StevenB
ID: 1336801
 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
 
LVL 1

Expert Comment

by:fsanchez
ID: 1336802
Sorry, I have found a mistake. Please replace '~' with 'not'.
0
 
LVL 7

Expert Comment

by:Inteqam
ID: 2609669
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
 
LVL 4

Author Comment

by:StevenB
ID: 2610390
 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
 
LVL 7

Expert Comment

by:Inteqam
ID: 2611408
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

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month20 days, left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question