bool CMainWindow::RegisterAndCreateWindow()
{
    WNDCLASSEX wcx;

    // Fill in the window class structure with default parameters
    wcx.cbSize = sizeof(WNDCLASSEX);
    wcx.style = CS_HREDRAW | CS_VREDRAW;
    wcx.lpfnWndProc = CWindow::stWinMsgHandler;
    wcx.cbClsExtra = 0;
    wcx.cbWndExtra = 0;
    wcx.hInstance = hResource;
    wcx.hCursor = NULL;
    ResString clsname(hResource, IDS_APP_TITLE);
    wcx.lpszClassName = clsname;
    wcx.hIcon = LoadIcon(hResource, MAKEINTRESOURCE(IDI_TORTOISEUDIFF));
    wcx.hbrBackground = (HBRUSH)(COLOR_3DFACE+1);
    wcx.lpszMenuName = MAKEINTRESOURCE(IDC_TORTOISEUDIFF);
    wcx.hIconSm = LoadIcon(wcx.hInstance, MAKEINTRESOURCE(IDI_TORTOISEUDIFF));
    if (RegisterWindow(&wcx))
    {
        if (Create(WS_CAPTION | WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_SIZEBOX | WS_SYSMENU | WS_CLIPCHILDREN, NULL))
        {
            m_FindBar.SetParent(*this);
            m_FindBar.Create(hResource, IDD_FINDBAR, *this);
            UpdateWindow(*this);
            return true;
        }
    }
    return false;
}
bool CMainWindow::RegisterAndCreateWindow()
{
    WNDCLASSEX wcx;

    // Fill in the window class structure with default parameters
    wcx.cbSize = sizeof(WNDCLASSEX);
    wcx.style = CS_HREDRAW | CS_VREDRAW;
    wcx.lpfnWndProc = CWindow::stWinMsgHandler;
    wcx.cbClsExtra = 0;
    wcx.cbWndExtra = 0;
    wcx.hInstance = hResource;
    wcx.hCursor = LoadCursor(NULL, IDC_SIZEWE);
    ResString clsname(hResource, IDS_APP_TITLE);
    wcx.lpszClassName = clsname;
    wcx.hIcon = LoadIcon(hResource, MAKEINTRESOURCE(IDI_TORTOISEIDIFF));
    wcx.hbrBackground = (HBRUSH)(COLOR_3DFACE+1);
    if (selectionPaths.empty())
        wcx.lpszMenuName = MAKEINTRESOURCE(IDC_TORTOISEIDIFF);
    else
        wcx.lpszMenuName = MAKEINTRESOURCE(IDC_TORTOISEIDIFF2);
    wcx.hIconSm = LoadIcon(wcx.hInstance, MAKEINTRESOURCE(IDI_TORTOISEIDIFF));
    if (RegisterWindow(&wcx))
    {
        if (Create(WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_VISIBLE, NULL))
        {
            UpdateWindow(m_hwnd);
            return true;
        }
    }
    return false;
}
Exemple #3
0
static const StringData* getInvokeName(ActRec *ar) {
  if (ar->hasInvName()) {
    return ar->getInvName();
  }
  auto func = ar->m_func;
  auto cls = func->cls();
  if (!cls) {
    return func->name();
  }
  String clsname(const_cast<StringData*>(cls->name()));
  String funcname(const_cast<StringData*>(func->name()));
  return makeStaticString(clsname + "::" + funcname);
}
/*!
  Returns the table name, which is generated from the class name.
*/
QString TSqlObject::tableName() const
{
    QString tblName;
    QString clsname(metaObject()->className());

    for (int i = 0; i < clsname.length(); ++i) {
        if (i > 0 && clsname[i].isUpper()) {
            tblName += '_';
        }
        tblName += clsname[i].toLower();
    }
    tblName.remove(QRegExp("_object$"));
    return tblName;
}
Exemple #5
0
bool CMainWindow::RegisterAndCreateWindow()
{
    WNDCLASSEX wcx;

    // Fill in the window class structure with default parameters
    wcx.cbSize = sizeof(WNDCLASSEX);
    wcx.style = CS_HREDRAW | CS_VREDRAW;
    wcx.lpfnWndProc = CWindow::stWinMsgHandler;
    wcx.cbClsExtra = 0;
    wcx.cbWndExtra = 0;
    wcx.hInstance = hResource;
    wcx.hCursor = NULL;
    ResString clsname(hResource, IDS_APP_TITLE);
    wcx.lpszClassName = clsname;
    wcx.hIcon = LoadIcon(hResource, MAKEINTRESOURCE(IDI_AACLR));
    wcx.hbrBackground = NULL;
    wcx.lpszMenuName = NULL;
    wcx.hIconSm = LoadIcon(wcx.hInstance, MAKEINTRESOURCE(IDI_AACLR));
    if (RegisterWindow(&wcx))
    {
        if (CreateEx(NULL, WS_POPUP, NULL))
        {
            // On Vista, the message TasbarCreated may be blocked by the message filter.
            // We try to change the filter here to get this message through. If even that
            // fails, then we can't do much about it and the task bar icon won't show up again.
            HMODULE hLib = LoadLibrary(_T("user32.dll"));
            if (hLib)
            {
                m_pChangeWindowMessageFilter = (CMainWindow::PFNCHANGEWINDOWMESSAGEFILTEREX)GetProcAddress(hLib, "ChangeWindowMessageFilterEx");
                if (m_pChangeWindowMessageFilter)
                {
                    (*m_pChangeWindowMessageFilter)(m_hwnd, WM_TASKBARCREATED, MSGFLT_ALLOW, NULL);
                    (*m_pChangeWindowMessageFilter)(m_hwnd, WM_SETTINGCHANGE, MSGFLT_ALLOW, NULL);
                }
            }

            ShowTrayIcon();
            return true;
        }
    }
    return false;
}
logical pc_ADK_Class_ :: InitResourceDB (char *clsnames, pc_ADK_Class_ &source_class )
{
  PropertyHandle   clsname(clsnames);
  int32            indx0 = 0;
  logical          term = NO;
BEGINSEQ
  if ( !source_class.Get(clsname) )                ERROR

  if ( !Provide(clsname) )
  {
    SDBCERR
    ERROR
  }

  while ( source_class.get_controls().Get(indx0++) )
    controls.InitResourceDB(source_class.get_controls());

RECOVER
  term = YES;
ENDSEQ
  return(term);
}
Exemple #7
0
        std::pair<abstract_factory<BasePlugin> *, dll_handle>
        get_abstract_factory_static(get_plugins_list_type f, DeleterType d,
            std::string const &class_name, std::string const& libname = "",
            error_code& ec = throws)
        {
            typedef typename boost::remove_pointer<get_plugins_list_type>
                ::type PointedType;

            exported_plugins_type& e = *f();
            std::string clsname(class_name);
            boost::algorithm::to_lower(clsname);

            typename exported_plugins_type::iterator it = e.find(clsname);
            if (it != e.end()) {
                abstract_factory<BasePlugin>** xw =
                    boost::unsafe_any_cast<abstract_factory<BasePlugin> *>
                    (&(*it).second);

                if (!xw) {
                    HPX_THROWS_IF(ec, filesystem_error,
                        "get_abstract_factory_static",
                        "Hpx.Plugin: Can't cast to the right factory type\n");
                    return std::pair<abstract_factory<BasePlugin> *, dll_handle>();
                }

                abstract_factory<BasePlugin> *w = *xw;
                return make_pair(w, boost::shared_ptr<PointedType>(f, d));
            }
            else {
                std::ostringstream str;
                str << "Hpx.Plugin: Class '" << class_name
                    << "' was not found";

                if (!libname.empty())
                    str << " in the shared library '" << libname << "'.";

                if (!e.empty()) {
                    str << " Existing classes: ";

                    bool first = true;
                    typename exported_plugins_type::iterator end = e.end();
                    for (typename exported_plugins_type::iterator jt = e.begin();
                         jt != end; ++jt)
                    {
                        if (first) {
                            str << "'" << (*jt).first << "'";
                            first = false;
                        }
                        else {
                            str << ", '" << (*jt).first << "'";
                        }
                    }
                    str << ".";
                }
                else {
                    str << " No classes exist.";
                }

                HPX_THROWS_IF(ec, filesystem_error,
                    "get_abstract_factory_static",
                    str.str());
                return std::pair<abstract_factory<BasePlugin> *, dll_handle>();
            }
        }