Solved

Transparency and ClipControls

Posted on 1997-06-03
10
328 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
 
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 170 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

929 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now