Solved

Transparency and ClipControls

Posted on 1997-06-03
10
326 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 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

20 Experts available now in Live!

Get 1:1 Help Now