MCPcopy Create free account
hub / github.com/EasyIME/PIME / showMessage

Method showMessage

PIMETextService/PIMETextService.cpp:349–369  ·  view source on GitHub ↗

message window

Source from the content-addressed store, hash-verified

347
348// message window
349void TextService::showMessage(Ime::EditSession* session, std::wstring message, int duration) {
350 // remove previous message if there's any
351 hideMessage();
352 // FIXME: reuse the window whenever possible
353 messageWindow_ = make_unique<Ime::MessageWindow>(this, session);
354 messageWindow_->setFont(font_);
355 messageWindow_->setText(message);
356
357 int x = 0, y = 0;
358 if(isComposing()) {
359 RECT rc;
360 if(selectionRect(session, &rc)) {
361 x = rc.left;
362 y = rc.bottom;
363 }
364 }
365 messageWindow_->move(x, y);
366 messageWindow_->show();
367
368 messageTimerId_ = ::SetTimer(messageWindow_->hwnd(), 1, duration * 1000, (TIMERPROC)TextService::onMessageTimeout);
369}
370
371void TextService::updateMessageWindow(Ime::EditSession* session) {
372 if (messageWindow_) {

Callers 1

updateMessageWindowMethod · 0.45

Calls 1

moveMethod · 0.45

Tested by

no test coverage detected