Esempio n. 1
0
void reconfigureEngine(void)
{
	//dbg_printf("Reconfigured skinner engine");
	readSettings();
	set_log_window();
	if (false == engine_running) return;
	refreshStyle();
	setTTC(APPLY_3DC);
}
Esempio n. 2
0
void LingTextEdit::setWritingSystem(const WritingSystem &ws)
{
    if( mWritingSystem != ws )
    {
        mWritingSystem = ws;
        refreshStyle();
        setLayoutDirection(ws.layoutDirection());
        setToolTip(ws.name());
    }
}
Esempio n. 3
0
void
Label::setAltered(bool a)
{
    if ( !canAlter() ) {
        return;
    }
    if (this->altered != a) {
        altered = a;
        refreshStyle();
    }
}
Esempio n. 4
0
WinListe::WinListe(QWidget *parent) :
  QMainWindow(parent)
{
  _ui.setupUi(this);

  setWindowTitle("GLst");

  // init media forms
  _frm[Media::eMTUnknown] = NULL;
  _frm[Media::eMTZik]   = new WinZik(this);
  _frm[Media::eMTFilm]  = new WinFilm(this);
  _frm[Media::eMTBook]  = new WinBook(this);

  // init settings form
  _frmOptions = new WinOptions(this);

  // init media menu
  _menu = new WinListeMenu(this);
  _ui.menuBar->addMenu(_menu);

  // set list controler
  _ui.listM->setCtrl(this);

  // load style
  refreshStyle();

  // group media type menu actions
  QActionGroup *CurrentMediaActionGroup = new QActionGroup(this);
  CurrentMediaActionGroup->addAction(_ui.actTypeFilms);
  CurrentMediaActionGroup->addAction(_ui.actTypeZik);
  CurrentMediaActionGroup->addAction(_ui.actTypeBook);

  // check the current media type
  switch (_opt.mediaType())
  {
    case Media::eMTFilm:  _ui.actTypeFilms->setChecked(true); break;
    case Media::eMTZik:   _ui.actTypeZik->setChecked(true); break;
    case Media::eMTBook:  _ui.actTypeBook->setChecked(true); break;
  }

  // events
  connect(_ui.listM, &QListWidget::itemDoubleClicked, this, &WinListe::showMod);

  // menu events
  connect(_ui.actOptions,   &QAction::triggered,  this, &WinListe::showOptions);
  connect(_ui.actExHTML,    &QAction::triggered,  this, &WinListe::exportHTML);
  connect(_ui.actTypeFilms, &QAction::triggered,  this, &WinListe::updateLstFromMenu);
  connect(_ui.actTypeZik,   &QAction::triggered,  this, &WinListe::updateLstFromMenu);
  connect(_ui.actTypeBook,  &QAction::triggered,  this, &WinListe::updateLstFromMenu);

  // update menu
  _menu->updateMenu();
}
Esempio n. 5
0
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	static UINT msgs[] = {BB_RECONFIGURE, BB_REDRAWGUI, BB_BROADCAST, 0};

	switch (message)
	{

	default:
		return DefWindowProc (hwnd, message, wParam, lParam);

	case WM_CREATE:
		m_hwnd = hwnd;
		SendMessage(BBhwnd, BB_REGISTERMESSAGE, (WPARAM)hwnd, (LPARAM)msgs);
		break;

	case WM_DESTROY:
		SendMessage(BBhwnd, BB_UNREGISTERMESSAGE, (WPARAM)hwnd, (LPARAM)msgs);
		break;

	case BB_BROADCAST:
		if (0 == memicmp((LPCSTR)lParam, "@BBLeanSkin.", 12))
		{
			const char *msg = (LPCSTR)lParam + 12;
			if (0 == stricmp(msg, "About"))
				about_box();
			else
				if (0 == stricmp(msg, "toggleLog"))
					goto toggle_log;
				else
					if (0 == stricmp(msg, "toggleSkin"))
					{
						if (engine_running)
						{
							write_log("\r\n\t---- stopping engine ----\r\n");
							PostMessage(hwnd, bbSkinMsg, MSGID_UNLOAD, 0);
							PostMessage(hwnd, BB_QUIT, 0, 0);
						}
						else
						{
							write_log("\r\n\t---- starting engine ----\r\n");
							startEngine();
						}
					}
		}
		break;

	case BB_QUIT:
		stopEngine();
		break;

	case BB_RECONFIGURE:
		if (is_plugin) // i.e. not loaded by BBWinSkin
			reconfigureEngine();
		break;

toggle_log:
		WriteBool(rcpath, "bbleanskin.option.enableLog:", false == enableLog);
		reconfigureEngine();
		break;

		//====================
		// used in combination with bbstylemaker to update the skin info
		// and optionally force active or button pressed state.

	case BB_REDRAWGUI:
		if (BBRG_WINDOW & wParam)
		{
			if (wParam & BBRG_STICKY)
			{   // and to transfer the is_sticky info from bb.
				PostMessage((HWND)lParam, bbSkinMsg, MSGID_BB_SETSTICKY, 0 != (wParam & BBRG_FOCUS));
				break;
			}

			static bool prev_opt;
			int opt = 0;
			if (prev_opt)               opt = MSGID_BBSM_RESET;
			if (wParam & BBRG_FOCUS)    opt = MSGID_BBSM_SETACTIVE;
			if (wParam & BBRG_PRESSED)  opt = MSGID_BBSM_SETPRESSED;
			prev_opt = opt >= MSGID_BBSM_SETACTIVE;

			if (opt) setEngineOption(opt);
			refreshStyle();
		}
		break;

		//====================
		// Log string sent by the engine dll

	case WM_COPYDATA:
	{
		if (201 == ((PCOPYDATASTRUCT)lParam)->dwData)
		{
			write_log((char*)((COPYDATASTRUCT*)lParam)->lpData);
			return TRUE;
		}
		break;
	}

	//====================
	// things for the Log EDIT control

	case WM_SETFOCUS:
		if (hwndLog) SetFocus(hwndLog);
		break;

	case WM_SIZE:
		if (hwndLog) MoveWindow(hwndLog, 0, 0, LOWORD(lParam), HIWORD(lParam), TRUE);
		break;

	case WM_CLOSE:
		if (hwndLog) goto toggle_log;
		break;
	}
	return 0 ;
}