First Steps /w ADX: Outlook Options Page...

Add-in Express™ Support Service
That's what is more important than anything else

First Steps /w ADX: Outlook Options Page...
 
Andrei Jugovic




Posts: 59
Joined: 2007-02-08
Hi!

I am just doing my first Steps with the ADX Komponents. I created a new Projekt using the ADX Outlook Add-in Template. I used the COM Add-in Wizard to set up the projectproperties. On the 3. page of the wizard I added an Option page wich should be addes to the Outlook options menu.

That worked very well. Now I have some questions about how to design this page.

1. The "nativ" Outlook Optionpages have a grey/wite background. My option page has the standard clBtnFace color. Of course I can change the backgroundcolor but how can I set the backgroundcolor of my option page to the backgroundcolor of all other option pages?

2. The controls I added to the form do not use the XP-Theme even so I added XP Manifest component to the form? What have I to do to use the XP style (for Buttons, Edits, etc.)?

Thanks
Andrei
Posted 08 Feb, 2007 11:47:12 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Andrei,

1. I think you need to draw a standard XP-themed background:


uses UxTheme;

// ...

procedure TADX_OptionsPageXP.PaintWindow(DC: HDC);
var
  Data: HTHEME;
  R: TRect;
begin
  inherited PaintWindow(DC);
  if (DC 
<>
 0) and not (csDesigning in ComponentState) then
    if UseThemes and IsAppThemed and IsThemeActive then begin
      Data := OpenThemeData(Self.Handle, 'tab');
      if Data 
<>
 0 then begin
        R := Rect(0, 0, Self.Width, Self.Height);
        DrawThemeBackground(Data, DC, TABP_BODY, 0, R, nil);
        CloseThemeData(Data);
      end;
    end;
end;


2. I think there are 2 ways:
- Create a "global" manifest file (Outlook.exe.manifest).
- Use 3rd party controls that can look like native XP-themed controls.

P.S. Note that we take up your forum requests in the order we receive them.
Besides, it may take us some time to investigate your issue. Please be sure we will let you know as soon as the best possible solution is found.

Posted 09 Feb, 2007 08:01:58 Top
Andrei Jugovic




Posts: 59
Joined: 2007-02-08
Hi!

Thanks for your tipps. I will try them out and let you know if they worked. Meanwhile I have an other question concering Optionpages:

User added an image

As you can see on the image the is an area at the bottom of the OptionPageForm which is not shown in Outlook? How can I correct this error?

Thanks
Andrei
Posted 11 Feb, 2007 07:33:46 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Andrei,

You can use the following code for adjusting your options page:


type
  TADX_OptionsPageXP = class(TActiveForm, IADX_OptionsPageXP, PropertyPage)
    // ...
  private
    FLock: boolean;
    // ...
    procedure WMSize(var Message: TWMSize); message WM_SIZE;
  protected
    // ...


procedure TADX_OptionsPageXP.WMSize(var Message: TWMSize);
begin
  inherited;
  if not FLock then begin
    FLock := True;
    try
      Height := Height + 32;
    finally
      FLock := False;
    end;
  end;
end;


Posted 12 Feb, 2007 05:37:11 Top