diff -r 4816d766a08a -r f345bda72bc4 Symbian3/PDK/Source/GUID-96E46D0E-1CE3-58B4-AE99-6B2E622ADAF9.dita --- a/Symbian3/PDK/Source/GUID-96E46D0E-1CE3-58B4-AE99-6B2E622ADAF9.dita Tue Mar 30 11:42:04 2010 +0100 +++ b/Symbian3/PDK/Source/GUID-96E46D0E-1CE3-58B4-AE99-6B2E622ADAF9.dita Tue Mar 30 11:56:28 2010 +0100 @@ -1,66 +1,66 @@ - - - - - -Transparent: -Drawing Transparent Windows -
Download

Click -on the following link to download the example: Transparent.zip

Click: browse to view the example code.

-
Description

This example application demonstrates -how to implement the following window server features using the RWindow::BeginRedraw() and RWindow::EndRedraw() functions:

    -
  • creating transparent, -non-transparent and blank windows,

  • -
  • changing the transparency -of a window,

  • -
  • drawing content on a -window.

  • -

Creating transparent windows

This example creates -a blank window on which a background and a foreground window are drawn. The -blank window is constructed using the RBlankWindow class. -The CPeriodic class triggers periodic redraws on the window. -The following functions are used to re-draw content on the window:

    -
  • RWindow::Invalidate()

  • -
  • RWindow::BeginRedraw()

  • -
  • RWindow::EndRedraw()

  • -
  • RWindow::Activate()

  • -

The transparency of the foreground window is changed using the following -functions:

    -
  • RWindow::SetTransparencyFactor(): -the transparency factor of the foreground window is incremented from 0 to -255 (transparent to opaque) using this function.

  • -
  • RWindow::SetTransparentRegion()

  • -

Related APIs

CPeriodic

RBlankWindow

RWindow::Activate()

RWindow::EndRedraw()

RWindow::Invalidate()

RWindow::SetTransparencyFactor()

RWindow::SetTransparentRegion()

Handling -window server events

The user-defined class CEventHandler handles -pointer events when transparent areas of the window are clicked on by the -pointer device. An appropriate message is displayed when a click event -is detected.

Related APIs

RWindow::BeginRedraw()

RWindow::EndRedraw()

-
Build

The -Symbian OS build process describes how to build this example.

The Transparent builds -an executable called transparent.exe in the standard -location (\epoc32\release\winscw\<build_variant> for -Carbide.c++).

-
Running the example

The examples creates three -windows:

    -
  • One background window -with height equal to the full emulator screen and width of half the emulator -screen. The "Background Window" label is set for this window.

  • -
  • Two foreground windows -half the size of the background window that are used for the two buttons respectively. -They can be identified by the labels set for the respective windows.

  • -

1. Press the Vary Transparency button on the -toolbar located at the right hand side of the window to vary the foreground -window's transparency. The transparency varies gradually from 0 to 255. This -use case demonstrates the RWindow::SetTransparencyFactor() API.

2. -Press the Set Transparent Region button to set the -user-defined transparent region in the foreground window. RWindow::SetTransparentRegion() is -called for the bottom half of the foreground window which ensures that the -bottom half remains transparent and the remaining window can have opaque pixels.

3. -Click different mouse buttons to display the respective popup messages

+ + + + + +Transparent: +Drawing Transparent Windows +
Download

Click +on the following link to download the example: Transparent.zip

Click: browse to view the example code.

+
Description

This example application demonstrates +how to implement the following window server features using the RWindow::BeginRedraw() and RWindow::EndRedraw() functions:

    +
  • creating transparent, +non-transparent and blank windows,

  • +
  • changing the transparency +of a window,

  • +
  • drawing content on a +window.

  • +

Creating transparent windows

This example creates +a blank window on which a background and a foreground window are drawn. The +blank window is constructed using the RBlankWindow class. +The CPeriodic class triggers periodic redraws on the window. +The following functions are used to re-draw content on the window:

    +
  • RWindow::Invalidate()

  • +
  • RWindow::BeginRedraw()

  • +
  • RWindow::EndRedraw()

  • +
  • RWindow::Activate()

  • +

The transparency of the foreground window is changed using the following +functions:

    +
  • RWindow::SetTransparencyFactor(): +the transparency factor of the foreground window is incremented from 0 to +255 (transparent to opaque) using this function.

  • +
  • RWindow::SetTransparentRegion()

  • +

Related APIs

CPeriodic

RBlankWindow

RWindow::Activate()

RWindow::EndRedraw()

RWindow::Invalidate()

RWindow::SetTransparencyFactor()

RWindow::SetTransparentRegion()

Handling +window server events

The user-defined class CEventHandler handles +pointer events when transparent areas of the window are clicked on by the +pointer device. An appropriate message is displayed when a click event +is detected.

Related APIs

RWindow::BeginRedraw()

RWindow::EndRedraw()

+
Build

The +Symbian build process describes how to build this example.

The Transparent builds +an executable called transparent.exe in the standard +location (\epoc32\release\winscw\<build_variant> for +Carbide.c++).

+
Running the example

The examples creates three +windows:

    +
  • One background window +with height equal to the full emulator screen and width of half the emulator +screen. The "Background Window" label is set for this window.

  • +
  • Two foreground windows +half the size of the background window that are used for the two buttons respectively. +They can be identified by the labels set for the respective windows.

  • +

1. Press the Vary Transparency button on the +toolbar located at the right hand side of the window to vary the foreground +window's transparency. The transparency varies gradually from 0 to 255. This +use case demonstrates the RWindow::SetTransparencyFactor() API.

2. +Press the Set Transparent Region button to set the +user-defined transparent region in the foreground window. RWindow::SetTransparentRegion() is +called for the bottom half of the foreground window which ensures that the +bottom half remains transparent and the remaining window can have opaque pixels.

3. +Click different mouse buttons to display the respective popup messages

\ No newline at end of file