コード例 #1
0
ファイル: Button.cpp プロジェクト: adhoah15/The-Powder-Toy
void Button::OnMouseHover(int x, int y)
{
	if(toolTip.length()>0 && GetParentWindow())
	{
		GetParentWindow()->ToolTip(this, ui::Point(x, y), toolTip);
	}
}
コード例 #2
0
void Button::OnMouseHover(int x, int y)
{
	if(Enabled && toolTip.length()>0 && GetParentWindow())
	{
		GetParentWindow()->ToolTip(Position, toolTip);
	}
}
コード例 #3
0
ファイル: Button.cpp プロジェクト: Ares26/The-Powder-Toy
void Button::OnMouseEnter(int x, int y)
{
    isMouseInside = true;
	if(!Enabled)
		return;
	if(actionCallback)
		actionCallback->MouseEnterCallback(this);
	if(toolTip.length()>0 && GetParentWindow())
	{
		GetParentWindow()->ToolTip(this, ui::Point(x, y), toolTip);
	}
}
コード例 #4
0
ファイル: msgs.cpp プロジェクト: kxepal/miranda-ng
static INT_PTR SendMessageCommandWorker(MCONTACT hContact, LPCSTR pszMsg, bool isWchar)
{
	hContact = db_mc_tryMeta(hContact);

	/* does the MCONTACT's protocol support IM messages? */
	char *szProto = GetContactProto(hContact);
	if (szProto == NULL)
		return 1; /* unknown contact */

	if (!CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND)
		return 1;

	HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, hContact);
	if (hwnd != NULL) {
		if (pszMsg) {
			HWND hEdit = GetDlgItem(hwnd, IDC_MESSAGE);
			SendMessage(hEdit, EM_SETSEL, -1, GetWindowTextLength(hEdit));
			if (isWchar)
				SendMessageW(hEdit, EM_REPLACESEL, FALSE, (LPARAM)pszMsg);
			else
				SendMessageA(hEdit, EM_REPLACESEL, FALSE, (LPARAM)pszMsg);
		}
		SendMessage(GetParent(hwnd), CM_POPUPWINDOW, 0, (LPARAM)hwnd);
	}
	else {
		NewMessageWindowLParam newData = { 0 };
		newData.hContact = hContact;
		newData.szInitialText = pszMsg;
		newData.isWchar = isWchar;
		HWND hParent = GetParentWindow(newData.hContact, FALSE);
		CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_MSG), hParent, DlgProcMessage, (LPARAM)&newData);
	}
	return 0;
}
コード例 #5
0
ファイル: mde_widget.cpp プロジェクト: prestocore/browser
bool MDE_Widget::GetScrollMoveAllowed()
{
	MDE_OpWindow *mdewin = (MDE_OpWindow*) GetParentWindow();
	if (mdewin && mdewin->GetCacheBitmap())
		return false;
	return true;
}
コード例 #6
0
void CPWL_IconList_Content::CreateChildWnd(const PWL_CREATEPARAM& cp) {
  for (int32_t i = 0; i < m_nListCount; i++) {
    CPWL_IconList_Item* pNewItem = new CPWL_IconList_Item();

    PWL_CREATEPARAM icp = cp;
    icp.pParentWnd = this;
    icp.dwFlags = PWS_CHILD | PWS_VISIBLE | PWS_NOREFRESHCLIP;
    pNewItem->Create(icp);
  }

  SetItemSpace(PWL_IconList_ITEM_SPACE);
  ResetContent(0);

  if (CPWL_Wnd* pParent = GetParentWindow()) {
    CPDF_Rect rcScroll = GetScrollArea();
    GetScrollPos();

    PWL_SCROLL_INFO sInfo;
    sInfo.fContentMin = rcScroll.bottom;
    sInfo.fContentMax = rcScroll.top;
    sInfo.fPlateWidth = GetClientRect().Height();
    sInfo.fSmallStep = 13.0f;
    sInfo.fBigStep = sInfo.fPlateWidth;

    pParent->OnNotify(this, PNM_SETSCROLLINFO, SBT_VSCROLL, (intptr_t)&sInfo);
  }
}
コード例 #7
0
ファイル: tzsioprs.c プロジェクト: arksoftgit/10c
/////////////////////////////////////////////////////////////////////////////
//
//    OPERATION: SironCreateDataModel
//
//
/////////////////////////////////////////////////////////////////////////////
zOPER_EXPORT zSHORT /*GLOBAL */  OPERATION
SironCreateDataModel( zVIEW vSubtask,
                      zPVIEW pvERD )
{
   zVIEW  vERD_Window;
   zVIEW  vTaskLPLR;

   GetViewByName( &vTaskLPLR, "TaskLPLR", vSubtask, zLEVEL_TASK );

   ActivateEmptyMetaOI( vSubtask, pvERD, zSOURCE_ERD_META,
                        zSINGLE | zLEVEL_APPLICATION );

   // Build Root Instance
   CreateMetaEntity( vSubtask, *pvERD, "EntpER_Model", zPOS_AFTER );
   SetAttributeFromAttribute( *pvERD, "EntpER_Model", "Name", vTaskLPLR, "LPLR", "Name" );
   SetAttributeFromString( *pvERD, "EntpER_Model", "Desc", "Siron Catalogs DataModel" );
   SetNameForView( *pvERD, "TZEREMDO", vSubtask, zLEVEL_TASK );

   // Data Model exists, enable ERD Control
   GetParentWindow( &vERD_Window, vSubtask );
   SetCtrlState( vERD_Window, "ERD", zCONTROL_STATUS_ENABLED, TRUE );

   // Set window Title with check out state
   SetTitleWithCheckOutState( vERD_Window, "Data Model", "TZEREMDO", *pvERD,
                              "EntpER_Model", zSOURCE_ERD_META );
   return( 0 );
} // SironCreateDataModel
コード例 #8
0
ファイル: CListBox.cpp プロジェクト: eriser/koblo_software-1
void CListBox::OnDraw(const SRect &rUpdate)
{
	if (mpDrawPrimitives == NULL) {
		mpDrawPrimitives = IDrawPrimitives::Create();
		mpDrawPrimitives->Init(GetParentWindow());
	}

	SRect rctDraw(GetPos(), SSize(GetSize().iCX, 10));

	tint32 iIndex = 0;
	std::list<std::string>::const_iterator it = mTexts.begin();
	for (; it != mTexts.end(); it++, iIndex++) {
		const std::string& sText = *it;

		DrawFont(dynamic_cast<IFontResource*>(GetBitmapResource()), rUpdate, rctDraw, (const tchar*)(sText.c_str()));

		if (iIndex == miDragIndex) {
			SRect rctInvert(rctDraw);
			rctInvert.iY -= 2;
			rctInvert.iCY += 4;
			mpDrawPrimitives->InvertRect(rUpdate, rctInvert);
		}

		rctDraw.iY += 14;
	}
} // OnDraw
コード例 #9
0
void CPWL_IconList_Content::ScrollToItem(int32_t nItemIndex) {
  CPDF_Rect rcClient = GetClientRect();

  if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex)) {
    CPDF_Rect rcOrigin = pItem->GetWindowRect();
    CPDF_Rect rcWnd = pItem->ChildToParent(rcOrigin);

    if (!(rcWnd.bottom > rcClient.bottom && rcWnd.top < rcClient.top)) {
      CPDF_Point ptScroll = GetScrollPos();

      if (rcWnd.top > rcClient.top) {
        ptScroll.y = rcOrigin.top;
      } else if (rcWnd.bottom < rcClient.bottom) {
        ptScroll.y = rcOrigin.bottom + rcClient.Height();
      }

      SetScrollPos(ptScroll);
      ResetFace();
      InvalidateRect();
      if (CPWL_Wnd* pParent = GetParentWindow()) {
        pParent->OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL,
                          (intptr_t)&ptScroll.y);
      }
    }
  }
}
コード例 #10
0
ファイル: helpchm.cpp プロジェクト: AlexHayton/decoda
bool wxCHMHelpController::DisplayContents()
{
    if (m_helpFile.IsEmpty())
        return false;

    wxString str = GetValidFilename(m_helpFile);

    return CallHtmlHelpFunction(GetParentWindow(), str, HH_DISPLAY_TOPIC, 0L);
}
コード例 #11
0
ファイル: helpchm.cpp プロジェクト: AlexHayton/decoda
// Use context number
bool wxCHMHelpController::DisplaySection(int section)
{
    if (m_helpFile.IsEmpty())
        return false;

    wxString str = GetValidFilename(m_helpFile);

    return CallHtmlHelpFunction(GetParentWindow(), str, HH_HELP_CONTEXT,
                                (DWORD)section);
}
コード例 #12
0
ファイル: PWL_ComboBox.cpp プロジェクト: documentcloud/pdfium
bool CPWL_CBListBox::OnCharWithExit(uint16_t nChar,
                                    bool& bExit,
                                    uint32_t nFlag) {
  if (!m_pList->OnChar(nChar, IsSHIFTpressed(nFlag), IsCTRLpressed(nFlag)))
    return false;
  if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetParentWindow())
    pComboBox->SetSelectText();

  OnNotifySelChanged(true, bExit, nFlag);

  return true;
}
コード例 #13
0
ファイル: PWL_ComboBox.cpp プロジェクト: hfiguiere/pdfium
FX_BOOL CPWL_CBListBox::OnCharWithExit(uint16_t nChar,
                                       FX_BOOL& bExit,
                                       uint32_t nFlag) {
  if (!m_pList->OnChar(nChar, IsSHIFTpressed(nFlag), IsCTRLpressed(nFlag)))
    return FALSE;
  if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetParentWindow())
    pComboBox->SetSelectText();

  OnNotifySelChanged(TRUE, bExit, nFlag);

  return TRUE;
}
コード例 #14
0
ファイル: PWL_ComboBox.cpp プロジェクト: documentcloud/pdfium
bool CPWL_CBButton::OnLButtonDown(const CFX_FloatPoint& point, uint32_t nFlag) {
  CPWL_Wnd::OnLButtonDown(point, nFlag);

  SetCapture();

  if (CPWL_Wnd* pParent = GetParentWindow()) {
    pParent->OnNotify(this, PNM_LBUTTONDOWN, 0,
                      PWL_MAKEDWORD(point.x, point.y));
  }

  return true;
}
コード例 #15
0
ファイル: PWL_ComboBox.cpp プロジェクト: azunite/libpdfium
FX_BOOL CPWL_CBButton::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) {
  CPWL_Wnd::OnLButtonDown(point, nFlag);

  SetCapture();

  if (CPWL_Wnd* pParent = GetParentWindow()) {
    pParent->OnNotify(this, PNM_LBUTTONDOWN, 0,
                      PWL_MAKEDWORD(point.x, point.y));
  }

  return TRUE;
}
コード例 #16
0
ファイル: msgs.cpp プロジェクト: kxepal/miranda-ng
static INT_PTR ReadMessageCommand(WPARAM, LPARAM lParam)
{
	CLISTEVENT *pcle = (CLISTEVENT*)lParam;
	MCONTACT hContact = db_mc_tryMeta(pcle->hContact);

	HWND hwndExisting = WindowList_Find(g_dat.hMessageWindowList, hContact);
	if (hwndExisting == NULL) {
		NewMessageWindowLParam newData = { 0 };
		newData.hContact = hContact;
		CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_MSG), GetParentWindow(hContact, FALSE), DlgProcMessage, (LPARAM)&newData);
	}
	else SendMessage(GetParent(hwndExisting), CM_POPUPWINDOW, 0, (LPARAM)hwndExisting);
	return 0;
}
コード例 #17
0
ファイル: tb_select.cpp プロジェクト: rongzhou/turbobadger
bool TBSelectList::OnEvent(const TBWidgetEvent &ev)
{
    if (ev.type == EVENT_TYPE_CLICK && ev.target->GetParent() == m_layout.GetContentRoot())
    {
        // SetValue (EVENT_TYPE_CHANGED) might cause something to delete this (f.ex closing
        // the dropdown menu. We want to sent another event, so ensure we're still around.
        TBWidgetSafePointer this_widget(this);

        int index = ev.target->data.GetInt();
        SetValue(index);

        // If we're still around, invoke the click event too.
        if (this_widget.Get())
        {
            TBSelectList *target_list = this;
            // If the parent window is a TBMenuWindow, we will iterate up the event destination
            // chain to find the top TBMenuWindow and invoke the event there.
            // That way events in submenus will reach the caller properly, and seem like it was
            // invoked on the top menu.
            TBWindow *window = GetParentWindow();
            while (TBMenuWindow *menu_win = TBSafeCast<TBMenuWindow>(window))
            {
                target_list = menu_win->GetList();
                window = menu_win->GetEventDestination()->GetParentWindow();
            }

            // Invoke the click event on the target list
            TBWidgetEvent ev(EVENT_TYPE_CLICK);
            if (TBWidget *widget = GetItemWidget(m_value))
                ev.ref_id = widget->GetID();
            target_list->InvokeEvent(ev);
        }
        return true;
    }
    else if (ev.type == EVENT_TYPE_KEY_DOWN)
    {
        if (ChangeValue(ev.special_key))
            return true;

        // Give the scroll container a chance to handle the key so it may
        // scroll. This matters if the list itself is focused instead of
        // some child view of any select item (since that would have passed
        // the container already)
        if (GetScrollContainer()->OnEvent(ev))
            return true;
    }
    return false;
}
コード例 #18
0
ファイル: msgs.cpp プロジェクト: kxepal/miranda-ng
static int MessageEventAdded(WPARAM hContact, LPARAM lParam)
{
	MEVENT hDbEvent = (MEVENT)lParam;
	DBEVENTINFO dbei = { sizeof(dbei) };
	db_event_get(hDbEvent, &dbei);
	if (dbei.eventType == EVENTTYPE_MESSAGE && (dbei.flags & DBEF_READ))
		return 0;

	HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, hContact);
	if (hwnd == NULL)
		hwnd = WindowList_Find(g_dat.hMessageWindowList, hContact = db_event_getContact(hDbEvent));
	if (hwnd)
		SendMessage(hwnd, HM_DBEVENTADDED, hContact, lParam);

	if (dbei.flags & DBEF_SENT || !DbEventIsMessageOrCustom(&dbei))
		return 0;

	pcli->pfnRemoveEvent(hContact, 1);
	/* does a window for the contact exist? */
	if (hwnd == NULL) {
		/* new message */
		SkinPlaySound("AlertMsg");
		if (IsAutoPopup(hContact)) {
			NewMessageWindowLParam newData = { 0 };
			newData.hContact = hContact;
			HWND hParent = GetParentWindow(newData.hContact, FALSE);
			newData.flags = NMWLP_INCOMING;
			CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_MSG), hParent, DlgProcMessage, (LPARAM)&newData);
			return 0;
		}
	}
	if (hwnd == NULL || !IsWindowVisible(GetParent(hwnd))) {
		TCHAR *contactName = (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0);
		TCHAR toolTip[256];

		CLISTEVENT cle = {};
		cle.flags = CLEF_TCHAR;
		cle.hContact = hContact;
		cle.hDbEvent = hDbEvent;
		cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
		cle.pszService = "SRMsg/ReadMessage";
		mir_sntprintf(toolTip, TranslateT("Message from %s"), contactName);
		cle.ptszTooltip = toolTip;
		pcli->pfnAddEvent(&cle);
	}
	return 0;
}
コード例 #19
0
ファイル: helpchm.cpp プロジェクト: AlexHayton/decoda
// Use topic or HTML filename
bool wxCHMHelpController::DisplaySection(const wxString& section)
{
    if (m_helpFile.IsEmpty())
        return false;

    wxString str = GetValidFilename(m_helpFile);

    // Is this an HTML file or a keyword?
    if ( section.Find(wxT(".htm")) != wxNOT_FOUND )
    {
        // interpret as a file name
        return CallHtmlHelpFunction(GetParentWindow(), str, HH_DISPLAY_TOPIC,
                                    wxPtrToUInt(section.c_str()));
    }

    return KeywordSearch(section);
}
コード例 #20
0
void ShowRoom(SESSION_INFO * si, WPARAM wp, BOOL bSetForeground)
{
	HWND hParent = NULL;
	if (!si)
		return;

	//Do we need to create a window?
	if (si->hWnd == NULL)
	{
	    hParent = GetParentWindow(si->windowData.hContact, TRUE);
	    si->hWnd = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_CHANNEL), hParent, RoomWndProc, (LPARAM)si);
	}
	SendMessage(si->hWnd, DM_UPDATETABCONTROL, -1, (LPARAM)si);
	SendMessage(GetParent(si->hWnd), CM_ACTIVATECHILD, 0, (LPARAM) si->hWnd);
	SendMessage(GetParent(si->hWnd), CM_POPUPWINDOW, 0, (LPARAM) si->hWnd);
	SendMessage(si->hWnd, WM_MOUSEACTIVATE, 0, 0);
	SetFocus(GetDlgItem(si->hWnd, IDC_CHAT_MESSAGE));
}
コード例 #21
0
ファイル: PWL_ComboBox.cpp プロジェクト: documentcloud/pdfium
bool CPWL_CBListBox::OnLButtonUp(const CFX_FloatPoint& point, uint32_t nFlag) {
  CPWL_Wnd::OnLButtonUp(point, nFlag);

  if (!m_bMouseDown)
    return true;

  ReleaseCapture();
  m_bMouseDown = false;

  if (!ClientHitTest(point))
    return true;
  if (CPWL_Wnd* pParent = GetParentWindow())
    pParent->OnNotify(this, PNM_LBUTTONUP, 0, PWL_MAKEDWORD(point.x, point.y));

  bool bExit = false;
  OnNotifySelChanged(false, bExit, nFlag);

  return !bExit;
}
コード例 #22
0
ファイル: msgs.cpp プロジェクト: kxepal/miranda-ng
static void RestoreUnreadMessageAlerts(void)
{
	OBJLIST<MSavedEvent> arEvents(10, NumericKeySortT);

	for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
		for (MEVENT hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) {
			DBEVENTINFO dbei = { sizeof(dbei) };
			dbei.cbBlob = 0;
			db_event_get(hDbEvent, &dbei);
			if ((dbei.flags & (DBEF_SENT | DBEF_READ)) || !DbEventIsMessageOrCustom(&dbei))
				continue;

			int windowAlreadyExists = WindowList_Find(g_dat.hMessageWindowList, hContact) != NULL;
			if (windowAlreadyExists)
				continue;

			if (IsAutoPopup(hContact) && !windowAlreadyExists) {
				NewMessageWindowLParam newData = { 0 };
				newData.hContact = hContact;
				newData.flags = NMWLP_INCOMING;
				HWND hParent = GetParentWindow(newData.hContact, FALSE);
				CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_MSG), hParent, DlgProcMessage, (LPARAM)&newData);
			}
			else arEvents.insert(new MSavedEvent(hContact, hDbEvent));
		}
	}

	TCHAR toolTip[256];

	CLISTEVENT cle = {};
	cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
	cle.pszService = "SRMsg/ReadMessage";
	cle.flags = CLEF_TCHAR;
	cle.ptszTooltip = toolTip;

	for (int i = 0; i < arEvents.getCount(); i++) {
		MSavedEvent &e = arEvents[i];
		mir_sntprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(e.hContact, 0));
		cle.hContact = e.hContact;
		cle.hDbEvent = e.hEvent;
		pcli->pfnAddEvent(&cle);
	}
}
コード例 #23
0
ファイル: helpchm.cpp プロジェクト: AlexHayton/decoda
bool wxCHMHelpController::KeywordSearch(const wxString& k,
                                        wxHelpSearchMode WXUNUSED(mode))
{
    if (m_helpFile.IsEmpty())
        return false;

    wxString str = GetValidFilename(m_helpFile);

    HH_AKLINK link;
    link.cbStruct =     sizeof(HH_AKLINK) ;
    link.fReserved =    FALSE ;
    link.pszKeywords =  k.c_str() ;
    link.pszUrl =       NULL ;
    link.pszMsgText =   NULL ;
    link.pszMsgTitle =  NULL ;
    link.pszWindow =    NULL ;
    link.fIndexOnFail = TRUE ;

    return CallHtmlHelpFunction(GetParentWindow(), str, HH_KEYWORD_LOOKUP,
                                wxPtrToUInt(&link));
}
コード例 #24
0
ファイル: tzcmrptd.c プロジェクト: arksoftgit/10c
/////////////////////////////////////////////////////////////////////////////
//
//    OPERATION: zwTZCMRPTD_LoadNewAudittrail
//
/////////////////////////////////////////////////////////////////////////////
zOPER_EXPORT zSHORT /*DIALOG */  OPERATION
zwTZCMRPTD_LoadNewAudittrail( zVIEW vSubtask )
{
   zVIEW   vTZCMCPL;
   zVIEW   vTZBRAU2O;
   zVIEW   vParentWindow;
   zULONG  ulZKey;
   zULONG  ulZKeyCPLR;
   zCHAR   szName[ 33 ];
   zCHAR   szControlText[40];

   GetViewByName( &vTZCMCPL, "TZCMCPL", vSubtask, zLEVEL_TASK );

   GetIntegerFromAttribute( (zPLONG) &ulZKey, vTZCMCPL, "CPLR", "ZKey" );
   GetStringFromAttribute( szName, vTZCMCPL, "CPLR", "Name" );

   if ( GetViewByName( &vTZBRAU2O, "TZBRAU2O", vSubtask, zLEVEL_TASK ) > 0 )
   {
      GetIntegerFromAttribute( (zPLONG) &ulZKeyCPLR, vTZBRAU2O, "CPLR", "ZKey" );
      if ( ulZKey == ulZKeyCPLR )
         return( 0 );
      else
         DropObjectInstance( vTZBRAU2O );
   }

   if ( zwfnTZCMRPTD_LoadNewAudittrail( vSubtask, &vTZBRAU2O ) < 0 )
   {
      return( -1 );
   }

   GetStringFromAttribute( szName, vTZCMCPL, "CPL", "Name" );
   zstrcpy( szControlText, " CPL: " );
   zstrcat( szControlText, szName );
   SetCtrlText( vSubtask, "txtCPL", szControlText );

   GetParentWindow( &vParentWindow, vSubtask );
   RefreshCtrl( vParentWindow, "lbCPLRList" );

   return( 0 );
} // zwTZCMRPTD_LoadNewAudittrail
コード例 #25
0
ファイル: PWL_ComboBox.cpp プロジェクト: azunite/libpdfium
FX_BOOL CPWL_CBListBox::OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) {
  CPWL_Wnd::OnLButtonUp(point, nFlag);

  if (m_bMouseDown) {
    ReleaseCapture();
    m_bMouseDown = FALSE;

    if (ClientHitTest(point)) {
      if (CPWL_Wnd* pParent = GetParentWindow()) {
        pParent->OnNotify(this, PNM_LBUTTONUP, 0,
                          PWL_MAKEDWORD(point.x, point.y));
      }

      FX_BOOL bExit = FALSE;
      OnNotifySelChanged(FALSE, bExit, nFlag);
      if (bExit)
        return FALSE;
    }
  }

  return TRUE;
}
コード例 #26
0
ファイル: helpchm.cpp プロジェクト: AlexHayton/decoda
bool wxCHMHelpController::DisplayContextPopup(int contextId)
{
    if (m_helpFile.IsEmpty()) return false;

    wxString str = GetValidFilename(m_helpFile);

    // We also have to specify the popups file (default is cshelp.txt).
    // str += wxT("::/cshelp.txt");

    HH_POPUP popup;
    popup.cbStruct = sizeof(popup);
    popup.hinst = (HINSTANCE) wxGetInstance();
    popup.idString = contextId ;

    GetCursorPos(& popup.pt);
    popup.clrForeground = ::GetSysColor(COLOR_INFOTEXT);
    popup.clrBackground = ::GetSysColor(COLOR_INFOBK);
    popup.rcMargins.top = popup.rcMargins.left = popup.rcMargins.right = popup.rcMargins.bottom = -1;
    popup.pszFont = NULL;
    popup.pszText = NULL;

    return CallHtmlHelpFunction(GetParentWindow(), str, HH_DISPLAY_TEXT_POPUP,
                                wxPtrToUInt(&popup));
}
コード例 #27
0
ファイル: camera.cpp プロジェクト: AndresPozo/phd2
CameraConfigDialogCtrlSet::CameraConfigDialogCtrlSet(wxWindow *pParent, GuideCamera *pCamera, AdvancedDialog *pAdvancedDialog, BrainCtrlIdMap& CtrlMap)
    : ConfigDialogCtrlSet(pParent, pAdvancedDialog, CtrlMap)
{
    assert(pCamera);

    m_pCamera = pCamera;

    if (m_pCamera->HasSubframes)
    {
        m_pUseSubframes = new wxCheckBox(GetParentWindow(AD_cbUseSubFrames), wxID_ANY, _("Use Subframes"));
        AddCtrl(CtrlMap, AD_cbUseSubFrames, m_pUseSubframes, _("Check to only download subframes (ROIs). Sub-frame size is equal to search region size."));
    }

    int numRows = (int)m_pCamera->HasGainControl + (int)m_pCamera->HasDelayParam + (int)m_pCamera->HasPortNum + 1;

    int width = StringWidth(_T("0000")) + 30;
    // Pixel size always
    m_pPixelSize = NewSpinnerDouble(GetParentWindow(AD_szPixelSize), width, m_pCamera->GetCameraPixelSize(), 0.0, 99.9, 0.1,
        _("Guide camera un-binned pixel size in microns. Used with the guide telescope focal length to display guiding error in arc-seconds."));
    AddLabeledCtrl(CtrlMap, AD_szPixelSize, _("Pixel size"), m_pPixelSize, "");

    // Gain control
    if (m_pCamera->HasGainControl)
    {
        int width = StringWidth(_T("0000")) + 30;
        m_pCameraGain = NewSpinnerInt(GetParentWindow(AD_szGain), width, 100, 0, 100, 1);
        AddLabeledCtrl(CtrlMap, AD_szGain, _("Camera gain"), m_pCameraGain, _("Camera gain, default = 95 % , lower if you experience noise or wish to guide on a very bright star. Not available on all cameras."));
    }

    // Binning
    m_binning = 0;
    if (m_pCamera->MaxBinning > 1)
    {
        wxArrayString opts;
        m_pCamera->GetBinningOpts(&opts);
        int width = StringArrayWidth(opts);
        m_binning = new wxChoice(GetParentWindow(AD_binning), wxID_ANY, wxPoint(-1, -1),
            wxSize(width + 35, -1), opts);
        AddLabeledCtrl(CtrlMap, AD_binning, _("Binning"), m_binning, _("Camera pixel binning"));
    }

    // Delay parameter
    if (m_pCamera->HasDelayParam)
    {
        int width = StringWidth(_T("0000")) + 30;
        m_pDelay = NewSpinnerInt(GetParentWindow(AD_szDelay), width, 5, 0, 250, 150);
        AddLabeledCtrl(CtrlMap, AD_szDelay, _("Delay"), m_pDelay, _("LE Read Delay (ms) , Adjust if you get dropped frames"));
    }

    // Port number
    if (m_pCamera->HasPortNum)
    {
        wxString port_choices[] = {
            _T("Port 378"), _T("Port 3BC"), _T("Port 278"), _T("COM1"), _T("COM2"), _T("COM3"), _T("COM4"),
            _T("COM5"), _T("COM6"), _T("COM7"), _T("COM8"), _T("COM9"), _T("COM10"), _T("COM11"), _T("COM12"),
            _T("COM13"), _T("COM14"), _T("COM15"), _T("COM16"),
        };

        int width = StringArrayWidth(port_choices, WXSIZEOF(port_choices));
        m_pPortNum = new wxChoice(GetParentWindow(AD_szPort), wxID_ANY, wxPoint(-1, -1),
            wxSize(width + 35, -1), WXSIZEOF(port_choices), port_choices);
        AddLabeledCtrl(CtrlMap, AD_szPort, _("LE Port"), m_pPortNum, _("Port number for long-exposure control"));
    }

    if (m_pCamera->HasCooler)
    {
        wxSizer *sz = new wxBoxSizer(wxHORIZONTAL);
        m_coolerOn = new wxCheckBox(GetParentWindow(AD_cooler), wxID_ANY, _("Cooler On"));
        m_coolerOn->SetToolTip(_("Turn camera cooler on or off"));
        sz->Add(m_coolerOn, wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL).Border(wxRIGHT));
        m_coolerSetpt = NewSpinnerInt(GetParentWindow(AD_szDelay), width, 5, -99, 99, 1);
        wxSizer *szt = MakeLabeledControl(AD_cooler, _("Set Temperature"), m_coolerSetpt, _("Cooler setpoint temperature"));
        sz->Add(szt, wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL));
        AddGroup(CtrlMap, AD_cooler, sz);
    }

    // Watchdog timeout
    {
        int width = StringWidth(_T("0000")) + 30;
        m_timeoutVal = NewSpinnerInt(GetParentWindow(AD_szCameraTimeout), width, 5, 5, 9999, 1);
        AddLabeledCtrl(CtrlMap, AD_szCameraTimeout, _("Disconnect nonresponsive\ncamera after (seconds)"), m_timeoutVal,
            wxString::Format(_("The camera will be disconnected if it fails to respond for this long. "
            "The default value, %d seconds, should be appropriate for most cameras."), DefaultGuideCameraTimeoutMs / 1000));
    }
}
コード例 #28
0
ファイル: helpchm.cpp プロジェクト: 0ryuO/dolphin-avsync
bool
wxCHMHelpController::DisplayTextPopup(const wxString& text, const wxPoint& pos)
{
    return ShowContextHelpPopup(text, pos, GetParentWindow());
}
コード例 #29
0
ファイル: helpchm.cpp プロジェクト: 0ryuO/dolphin-avsync
bool wxCHMHelpController::DisplayContextPopup(int contextId)
{
    return DoDisplayTextPopup(NULL, wxGetMousePosition(), contextId,
                              GetParentWindow());
}
コード例 #30
0
ファイル: helpchm.cpp プロジェクト: AlexHayton/decoda
bool wxCHMHelpController::Quit()
{
    return CallHtmlHelpFunction(GetParentWindow(), NULL, HH_CLOSE_ALL, 0L);
}