Share via


Customizing the Candidate List Area (Windows Embedded CE 6.0)

1/6/2010

The candidate list area displays the candidate list. This area is a mandatory part of the candidate window.

The following table shows the methods provided by CImeCUICandWindow::CCandListArea::Item subclass to customize the candidate list area.

Method Description

CImeCUICandWindow::CCandListArea::Item::CreateRenderingMetrics

Allocates a memory block and stores item metrics.

CImeCUICandWindow::CCandListArea::Item::FreeRenderingMetrics

Frees a memory block allocated by CreateRenderingMetrics.

CImeCUICandWindow::CCandListArea::Item::GetSize

Retrieves the size of the bounding rectangle of the item.

CImeCUICandWindow::CCandListArea::Item::SetSize

Sets the size of the bounding rectangle of the item after adjustments are made by the IME.

CImeCUICandWindow::CCandListArea::Item::PaintBackground

Draws the background of the item.

CImeCUICandWindow::CCandListArea::Item::PaintCandidateString

Draws the candidate string.

CImeCUICandWindow::CCandListArea::Item::PaintInlineComment

Draws the inline comment string.

To align the candidate string and the inline comment string in the candidate list area, the drawing code is able to determine the maximum width of the candidate information and the inline comment strings. For the drawing code to determine the maximum width, the IME calls the CImeCUICandWindow::CCandListArea::Item::CreateRenderingMetrics method, and passes a list of the candidate strings to the method. CreateRenderingMetrics enumerates the candidate strings and calculates their size.

After calculating the size of the candidate strings, CreateRenderingMetrics allocates a memory block, stores the size information to it, and return the handle to the memory block to the IME. The IME passes the handle to the memory block to the actual drawing code, so that the drawing code can determine the required size and can draw the candidate string at the correct position. To free the memory block allocated by CreateRenderingMetrics, the IME must call the CImeCUICandWindow::CCandListArea::Item::FreeRenderingMetrics method.

The CImeCUICandWindow::CCandListArea::Item::GetSize method returns the size of the candidate item, which was, in most cases, calculated by CreateRenderingMetrics. If the width of the candidate item returned from GetSize is too narrow in relation to the readings and bottom information areas, the IME may need to widen the size of the item to display these areas correctly.

The IME calls the CImeCUICandWindow::CCandListArea::Item::SetSize method with the updated size information. SetSize will update the size information in the memory block allocated by CreateRenderingMetrics.

To specify the number of candidates to be displayed in the candidate list area at once, the IME calls the CImeCUICandWindow::GetMaxItems method. If the number of candidates is greater than the number specified by CImeCUICandWindow::GetMaxItems, the scrollbar is enabled to scroll the list.

If the number of candidates is less than or equal to the number specified by CImeCUICandWindow::GetMaxItems, the scrollbar is disabled. You can also hide the scrollbar, even though it is disabled by default. If a call to the CImeCUICandWindow::CCandListArea::ScrollBar::IsVisibleAlways method returns FALSE, the scrollbar is automatically hidden when it is not required.

See Also

Other Resources

Customizing the Candidate Window