コード例 #1
0
ファイル: ZdCtlTim.cpp プロジェクト: DeegC/10d
UINT
fnTimerThreadProc( zPVOID p )
{
   ZTimer  *pZTimer = (ZTimer *) p;
   HWND    hWnd = pZTimer->m_hWnd;
   zUSHORT uInterval = (zUSHORT) pZTimer->m_lInterval;
// DWORD   dwStart = GetTickCount( );

   // Stop if this has taken too long
// if( GetTickCount() - dwStart >= TIMELIMIT )
//     Cancel();

#ifdef DEBUG_ALL
   TraceLineI( "Starting Thread: ", (zLONG) AfxGetThread( ) );
#endif

   while ( mIs_hWnd( hWnd ) && pZTimer->m_bEnabled )
   {
      SysWait( uInterval );
      if ( mIs_hWnd( hWnd ) )
         ProcessImmediateEvent( pZTimer, 1, 0 );
   }

#ifdef DEBUG_ALL
   TraceLineI( "All Done!!! Exiting Thread: ", (zLONG) AfxGetThread( ) );
#endif

   if ( mIs_hWnd( hWnd ) )
      pZTimer->m_pThread = 0;

   return( 0 );

} // fnTimerThreadProc
コード例 #2
0
ファイル: ZdCtlChk.cpp プロジェクト: arksoftgit/10c
void
ZCheckBox::CreateZ( )
{
   if ( m_ulMapActFlags & zMAPACT_VISIBLE )
      Attr.Style |= WS_VISIBLE;
   else
      Attr.Style &= ~WS_VISIBLE;

   if ( m_ulMapActFlags & zMAPACT_ENABLED )
      Attr.Style &= ~WS_DISABLED;
   else
      Attr.Style |= WS_DISABLED;

#ifdef zREMOTE_SERVER
   m_ulMapActFlag2 |= zMAPACT_CREATE_CHILDREN | zMAPACT_CREATED1;
#else
   if ( mIs_hWnd( m_hWnd ) ||
        (m_pWndParent && mIs_hWnd( m_pWndParent->m_hWnd ) &&
         CreateEx( 0 /*WS_EX_CLIENTEDGE*/, "BUTTON", *m_pzsText,
                   BS_CHECKBOX | BS_OWNERDRAW | Attr.Style,
                   Attr.X, Attr.Y, Attr.W, Attr.H,
                   m_pWndParent->m_hWnd, (HMENU) m_nIdNbr )) )
   {
      m_ulMapActFlag2 |= zMAPACT_CREATE_CHILDREN | zMAPACT_CREATED1;
   }
#endif
}
コード例 #3
0
ファイル: ZdCtl.cpp プロジェクト: DeegC/ZeidonTools
void
ZTitleTip::OnTimer( UINT uIdTimer )
{
// TraceLine( "ZTitleTip::OnTimer Id: %d", uIdTimer );

   if ( uIdTimer == m_uToolTipTimerId && mIs_hWnd( m_hWnd ) )
   {
      CPoint pt;

      if ( GetCursorPos( &pt ) )  // Where is the mouse right now?
      {
         // Over which window?
      // TracePoint( "ZTitleTip::OnTimer pt: ", pt );
      //xCWnd *pWnd = WindowFromPoint( pt );
      //xif ( GetSafeHwnd( ) == pWnd->GetSafeHwnd( ) )
      //x{
         // TraceLineS( "ZTitleTip::OnTimer ShowWindow ACTIVE", "" );
            ShowWindow( SW_SHOWNOACTIVATE );
      //x}

         DrawTipText( 2 );
      }

      KillTimer( m_uToolTipTimerId );
      m_uToolTipTimerId = 0;
   }

   CWnd::OnTimer( uIdTimer );
}
コード例 #4
0
ファイル: ZdCtlHot.cpp プロジェクト: DeegC/10d
BOOL
CHyperLink:: ModifyLinkStyle( DWORD dwRemove, DWORD dwAdd,
                             BOOL bApply /* =TRUE */ )
{
   // Check if we are adding and removing the same style.
   if ( (dwRemove & dwAdd) != 0 )
      return( FALSE );

   // Remove old styles and set the new ones
   CLEARBITS( m_dwStyle, dwRemove );
   SETBITS( m_dwStyle, dwAdd );

   if ( bApply && mIs_hWnd( GetSafeHwnd( ) ) )
   {
      // If possible, APPLY the new styles on the fly.
      if ( BITSET( dwAdd, StyleUnderline ) ||
           BITSET( dwRemove, StyleUnderline ) )
      {
         SwitchUnderline( );
      }

      if ( BITSET( dwAdd, StyleAutoSize ) )
         AdjustWindow( );

      if ( BITSET( dwRemove, StyleUseHover ) )
         Invalidate( );
   }

   return( TRUE );
}
コード例 #5
0
ファイル: ZDrOpt.cpp プロジェクト: arksoftgit/10c
void
ZSubtask::AddBarTip( HWND hWnd, zLONG lFirstId, zLONG lLastId )
{
   ZBarTip *pBarTip;
   zSHORT nPos = m_nBarTipCnt;

   while ( nPos )
   {
      nPos--;
      pBarTip = m_BarTipList[ nPos ];
      if ( pBarTip->m_hWnd == hWnd )
      {
         pBarTip->m_lFirstId = lFirstId;
         pBarTip->m_lLastId = lLastId;
         return;
      }
      else
      if ( mIs_hWnd( pBarTip->m_hWnd ) == FALSE )
      {
         m_BarTipList.RemoveAt( nPos );
         m_nBarTipCnt--;
         nPos = m_nBarTipCnt;
         mDeleteInit( pBarTip );
      }
   }

   pBarTip = new ZBarTip( hWnd, lFirstId, lLastId );
   m_BarTipList.SetAtGrow( m_nBarTipCnt++, pBarTip );
}
コード例 #6
0
ファイル: ZdCtlMLE.cpp プロジェクト: DeegC/ZeidonTools
zBOOL
ZMLE::HandleQuickKey( zACCEL_DEF ad )
{
#ifdef DEBUG_ALL
   TraceLineS( "ZMLE::HandleQuickKey: ", *m_pzsTag );
#endif

   if ( ad.uVK == VK_TAB && ad.fAlt == 0 && ad.fCtrl == 1 )
   {
      ReplaceSel( "\t", TRUE );
      return( TRUE );
   }
   else
   if ( ad.uVK == VK_TAB && ad.fAlt == 0 && ad.fCtrl == 0 )
   {
      ZMapAct *pzma = m_pZSubtask->
         GetFocusCtrlWithinComposite( 0, this, !ad.fShift );
      if ( pzma && pzma->m_pCtrl && mIs_hWnd( pzma->m_pCtrl->m_hWnd ) )
      {
         pzma->m_pCtrl->SetFocus( );
      }

      return( TRUE );
   }
   else
   if ( ad.uVK == VK_RETURN )
   {
      if ( ad.fAlt == 0 )
      {
         ReplaceSel( "\r\n", TRUE );
      }
      else
      if ( ad.fAlt &&
           m_pZSubtask->m_pCurrDfltBtn &&
           m_pZSubtask->m_pCurrDfltBtn->m_pCtrl &&
           mIs_hWnd( m_pZSubtask->m_pCurrDfltBtn->m_pCtrl->m_hWnd ) )
      {
         m_pZSubtask->m_pCurrDfltBtn->m_pCtrl->SendMessage( WM_LBUTTONDOWN );
         m_pZSubtask->m_pCurrDfltBtn->m_pCtrl->SendMessage( WM_LBUTTONUP );
      }

      return( TRUE );
   }

   return( FALSE );
}
コード例 #7
0
ファイル: ZdCtlHot.cpp プロジェクト: DeegC/10d
// Move and resize the window so that its client area has the same size
// as the hyperlink text. This prevents the hyperlink cursor being active
// when it is not over the text.
void
CHyperLink::AdjustWindow( )
{
   ASSERT( mIs_hWnd( GetSafeHwnd( ) ) );

   if ( !BITSET( m_dwStyle, StyleAutoSize ) )
        return;

    // Get the current window rect
    CRect rcWnd;
    GetWindowRect( rcWnd );

   // For a child CWnd object, window rect is relative to the
   // upper-left corner of the parent window’s client area.
    CWnd *pParent = GetParent( );
    if ( pParent )
        pParent->ScreenToClient( rcWnd );

   // Get the current client rect
   CRect rcClient;
   GetClientRect( rcClient );

   // Calc border size based on window and client rects.
   int borderWidth = rcWnd.Width( ) - rcClient.Width( );
   int borderHeight = rcWnd.Height( ) - rcClient.Height( );

   // Get the extent of window text
   CString csWndText;
   GetWindowText( csWndText );

   CDC *pDC = GetDC( );
   CFont *pOldFont = pDC->SelectObject( &m_Font );
   CSize Extent = pDC->GetTextExtent( csWndText );
   pDC->SelectObject( pOldFont );
   ReleaseDC( pDC );

   // Get the text justification style.
   DWORD dwStyle = GetStyle( );

   // Recalc window size and position based on text justification.
   if ( BITSET( dwStyle, SS_CENTERIMAGE ) )
      rcWnd.DeflateRect( 0, (rcWnd.Height( ) - Extent.cy) / 2 );
   else
      rcWnd.bottom = rcWnd.top + Extent.cy;

   if ( BITSET( dwStyle, SS_CENTER ) )
      rcWnd.DeflateRect( (rcWnd.Width( ) - Extent.cx) / 2, 0 );
   else
   if ( BITSET( dwStyle, SS_RIGHT ) )
      rcWnd.left  = rcWnd.right - Extent.cx;
   else // SS_LEFT
      rcWnd.right = rcWnd.left + Extent.cx;

   // Move and resize the window.
   MoveWindow( rcWnd.left, rcWnd.top, rcWnd.Width( ) + borderWidth,
               rcWnd.Height( ) + borderHeight );
}
コード例 #8
0
ファイル: ZdCtlTim.cpp プロジェクト: DeegC/10d
// ZTime - dtor
ZTime::~ZTime( )
{
#ifdef DEBUG_ALL
   TraceLineS( "ZTime::dtor ", *m_pzsTag );
#endif

   if ( mIs_hWnd( m_hWnd ) )
      DestroyWindow( );
}
コード例 #9
0
ファイル: ZdCtlTim.cpp プロジェクト: DeegC/10d
// ZTimer - dtor
ZTimer::~ZTimer( )
{
#ifdef DEBUG_ALL
   TraceLineS( "ZTimer::dtor ", *m_pzsTag );
#endif

   m_bEnabled = FALSE;
   if ( mIs_hWnd( m_hWnd ) )
      DestroyWindow( );
}
コード例 #10
0
ファイル: ZdCtlMLE.cpp プロジェクト: DeegC/ZeidonTools
// ZMLE - dtor
ZMLE::~ZMLE( )
{
// TraceLineS( "ZMLE::~ZMLE", "" );

// if ( m_hEditDS )
//    GlobalFree( m_hEditDS );

   if ( mIs_hWnd( m_hWnd ) )
      DestroyWindow( );
}
コード例 #11
0
ファイル: ZdCtlChk.cpp プロジェクト: arksoftgit/10c
void
ZCheckBox::SetCheck( zBOOL bCheck )
{
#ifdef zREMOTE_SERVER
   SetRemoteZCtrlAttribute( this, m_csERemote, "Checked",
                            bCheck ? "Y" : "N" );
#else
   if ( mIs_hWnd( m_hWnd ) )
      CButton::SetCheck( bCheck );
#endif
}
コード例 #12
0
ファイル: ZdCtlTim.cpp プロジェクト: DeegC/10d
void
ZTimer::CreateZ( )
{
#ifdef DEBUG_ALL
   TraceLineS( "ZTimer::CreateZ ", *m_pzsTag );
#endif

#ifdef zREMOTE_SERVER
   m_ulMapActFlag2 |= zMAPACT_CREATE_CHILDREN | zMAPACT_CREATED1;
#else
   if ( mIs_hWnd( m_hWnd ) ||
        (m_pWndParent && mIs_hWnd( m_pWndParent->m_hWnd ) &&
         Create( *m_pzsText, (Attr.Style & ~WS_BORDER),
                 CRect( 0, 0, 0, 0 ),
                 m_pWndParent, m_nIdNbr )) )
   {
      m_ulMapActFlag2 |= zMAPACT_CREATE_CHILDREN | zMAPACT_CREATED1;
   }
#endif
}
コード例 #13
0
ファイル: ZdCtlTim.cpp プロジェクト: DeegC/10d
void
ZTime::CreateZ( )
{
#ifdef DEBUG_ALL
   TraceLineS( "ZTime::CreateZ ", *m_pzsTag );
#endif

#ifdef zREMOTE_SERVER
   m_ulMapActFlag2 |= zMAPACT_CREATE_CHILDREN | zMAPACT_CREATED1;
#else

   if ( mIs_hWnd( m_hWnd ) ||
        (m_pWndParent && mIs_hWnd( m_pWndParent->m_hWnd ) &&
         Create( 0, "STATIC", WS_VISIBLE | WS_CHILD | WS_TABSTOP,
                 CRect( Attr.X, Attr.Y, Attr.X + Attr.W, Attr.Y + Attr.H ),
                 m_pWndParent, m_nIdNbr )) )
   {
      m_ulMapActFlag2 |= zMAPACT_CREATE_CHILDREN | zMAPACT_CREATED1;
   }
#endif
}
コード例 #14
0
ファイル: TzCtlTAB.cpp プロジェクト: DeegC/10d
void
TZNotePage::RealizeCtrl( zBOOL bCreate )
{
#ifdef DEBUG_ALL
   TraceLineI( "TZNotePage::RealizeCtrl", bCreate );
#endif
   if ( bCreate )
      TZPainterCtrl::RealizeCtrl( TRUE );

   if ( m_pWndCtrl && mIs_hWnd( m_pWndCtrl->m_hWnd ) )
      m_pWndCtrl->ShowWindow( bCreate ? SW_SHOW : SW_HIDE );
}
コード例 #15
0
ファイル: ZdCtlHot.cpp プロジェクト: DeegC/10d
void
CHyperLink::SetURL( CString csURL )
{
   m_csURL = csURL;

   if ( mIs_hWnd( GetSafeHwnd( ) ) )
   {
      ShowWindow( SW_HIDE );
      AdjustWindow( );
      m_ToolTip.UpdateTipText( csURL, this, TOOLTIP_ID );
      ShowWindow( SW_SHOW );
   }
}
コード例 #16
0
ファイル: ZdCtlMLE.cpp プロジェクト: DeegC/ZeidonTools
void
ZMLE::CreateZ( )
{
   if ( m_ulMapActFlags & zMAPACT_VISIBLE )
      Attr.Style |= WS_VISIBLE;
   else
      Attr.Style &= ~WS_VISIBLE;

#ifdef zREMOTE_SERVER
   m_ulMapActFlag2 |= zMAPACT_CREATE_CHILDREN | zMAPACT_CREATED1;
#else
   // The "disabled" property is set during OnCreate using the ReadOnly flag.
   if ( mIs_hWnd( m_hWnd ) ||
        (m_pWndParent && mIs_hWnd( m_pWndParent->m_hWnd ) &&
         CreateEx( WS_EX_CLIENTEDGE, "EDIT", *m_pzsText,
                   Attr.Style, Attr.X, Attr.Y, Attr.W, Attr.H,
                   m_pWndParent->m_hWnd, (HMENU) m_nIdNbr )) )
   {
      m_ulMapActFlag2 |= zMAPACT_CREATE_CHILDREN | zMAPACT_CREATED1;
   }
#endif
}
コード例 #17
0
ファイル: ZdCtlChk.cpp プロジェクト: arksoftgit/10c
zLONG
ZCheckBox::GetZCtrlState( zLONG lStatusType )
{
   if ( lStatusType == zCONTROL_STATUS_CHECKED )
   {
#ifdef zREMOTE_SERVER
      return( (GetCheck( ) == 0) ? FALSE : TRUE );
#else
      if ( mIs_hWnd( m_hWnd ) )
         return( (GetCheck( ) == 0) ? FALSE : TRUE );
      else
         return( FALSE );
#endif
   }
   else
      return( ZMapAct::GetZCtrlState( lStatusType ) );
}
コード例 #18
0
ファイル: TzCtlTAB.cpp プロジェクト: DeegC/10d
void
TZNoteBook::SelectPoint( CPoint pt )
{
#ifdef DEBUG_ALL
   TracePoint( "TZNoteBook::SelectPoint", pt );
#endif
   if ( mIs_hWnd( m_hWnd ) == 0 )
      return;

   PostMoveCtrl( );
   m_bDeletable = TRUE;    // mark it as deletable

   CWnd *pWndDlgItem = GetDlgItem( 1 );
   if ( pWndDlgItem )
   {
   // MessageBox( "TZNoteBook::SelectPoint", "Found DlgItem" );
   // TraceLineX( "TZNoteBook::SelectPoint DlgItem: ",
   //             (zLONG) pWndDlgItem->m_hWnd );
      CWnd *pWndChild = ChildWindowFromPoint( pt, CWP_SKIPINVISIBLE );
      if ( pWndChild )
      {
      // TraceLineX( "TZNoteBook::SelectPoint ChildFromPt: ",
      //             (zLONG) pWndChild->m_hWnd );
         if ( pWndDlgItem->m_hWnd == pWndChild->m_hWnd )
         {
            ClientToScreen( &pt );
            pWndDlgItem->ScreenToClient( &pt );
            pWndDlgItem->SendMessage( WM_LBUTTONDOWN, 0, MAKELONG( pt.x, pt.y ) );
            pWndDlgItem->SendMessage( WM_LBUTTONUP, 0, MAKELONG( pt.x, pt.y ) );
            return;
         }
      }
   }

   SendMessage( WM_LBUTTONDOWN, 0, MAKELONG( pt.x, pt.y ) );
   SendMessage( WM_LBUTTONUP, 0, MAKELONG( pt.x, pt.y ) );
//x   zSHORT nActiveTabNbr = GetActivePage( );
// TraceLineI( "TZNoteBook::Select New ActiveTab = ", nActiveTabNbr );
//xif ( nActiveTab != m_nActiveTabNbr )
//x      ActivateTab( nActiveTabNbr );

// TraceLineI( "TZNoteBook::Select Activating tab IdNbr ", GetTabID( ) );
// TraceLineI( "                         tab number ", m_nActiveTabNbr );
// TraceLineI( "                    real tab number ", GetTab( ) );
}
コード例 #19
0
ファイル: TzCtlTAB.cpp プロジェクト: DeegC/10d
void
TZNoteBook::RealizeCtrl( zBOOL bCreate )
{
#ifdef DEBUG_ALL
   TraceLineI( "TZNoteBook::RealizeCtrl bCreate = ", bCreate );
#endif
   if ( bCreate )
   {
      TZPainterCtrl::RealizeCtrl( TRUE );
   // TZNotePage *pCurrNotePage = GetActivePage( );
   // if ( pCurrNotePage )
   // {
   //    ActivateTab( pCurrNotePage->m_nTabNbr );
   // }
   }

   if ( m_pWndCtrl && mIs_hWnd( m_pWndCtrl->m_hWnd ) )
      m_pWndCtrl->ShowWindow( bCreate ? SW_SHOW : SW_HIDE );
}
コード例 #20
0
ファイル: ZdCtlChk.cpp プロジェクト: arksoftgit/10c
zLONG
ZCheckBox::SetZCtrlState( zLONG lStatusType,
                          zULONG ulValue )
{
   if ( lStatusType == zCONTROL_STATUS_CHECKED )
   {
#ifdef zREMOTE_SERVER
      SetRemoteZCtrlAttribute( this, "CheckBox",
                               "Checked", ulValue ? "Y" : "N" );
#else
      if ( mIs_hWnd( m_hWnd ) )
         SetCheck( ulValue ? 1 : 0 );
#endif

      return( 0 );
   }
   else
      return( ZMapAct::SetZCtrlState( lStatusType, ulValue ) );
}
コード例 #21
0
ファイル: ZdCtlHot.cpp プロジェクト: DeegC/10d
void
CHyperLink::SetWindowText( zCPCHAR cpcText )
{
   ASSERT( cpcText );

   if ( mIs_hWnd( GetSafeHwnd( ) ) )
   {
      // Set the window text and adjust its size while the window
      // is kept hidden in order to allow dynamic modification.
      ShowWindow( SW_HIDE );          // hide window

      // Call the base class SetWindowText( ).
      CStatic::SetWindowText( cpcText );

      // Resize the control if necessary.
      AdjustWindow( );
      ShowWindow( SW_SHOW );          // show window
   }
}
コード例 #22
0
ファイル: ZdCtlChk.cpp プロジェクト: arksoftgit/10c
// ZCheckBox - dtor
ZCheckBox::~ZCheckBox( )
{
// TraceLineS( "ZCheckBox::~ZCheckBox", "" );
   if ( mIs_hWnd( m_hWnd ) )
      DestroyWindow( );

   mDeleteInit( m_pzsValueOn );
   mDeleteInit( m_pzsValueOff );
   m_clr = CLR_INVALID;
   for ( int k = 0; k < 6; k++ )
   {
      if ( m_bitmaps[ k ] )
      {
         DeleteObject( m_bitmaps[ k ] );  // it was subscript 0???
         m_bitmaps[ k ] = 0;
      }
   }

// DeleteObject( m_pFont );
}
コード例 #23
0
ファイル: ZdCtlChk.cpp プロジェクト: arksoftgit/10c
zBOOL
ZCheckBox::GetCheck( )
{
   zBOOL bRC = FALSE;

#ifdef zREMOTE_SERVER
   zCHAR  szYN[ 2 ];

   if ( GetRemoteZCtrlAttribute( this, m_csERemote,
                                 "Checked", szYN, sizeof( szYN ) ) >= 0 )
   {
      if ( *szYN == 'Y' || *szYN == 'y' )
         bRC = TRUE;
   }
#else
   if ( mIs_hWnd( m_hWnd ) )
      bRC = (zBOOL) CButton::GetCheck( );
#endif

   return( bRC );
}
コード例 #24
0
ファイル: TzCtlTAB.cpp プロジェクト: DeegC/10d
TZPainterCtrl *
TZNotePage::AdjustCtrlRect( CRect& rect,
                            zBOOL  bToPainterRect )
{
#ifdef DEBUG_ALL
   TraceRect( "TZNotePage::AdjustCtrlRect1", rect );
#endif

   if ( mIs_hWnd( m_pZNoteBook->m_hWnd ) )
   {
      CRect rectClient;
      m_pZNoteBook->GetClientRect( rectClient );
      m_pZNoteBook->AdjustRect( FALSE, &rectClient );

      zLONG lLeft = rectClient.left;
      zLONG lTop = rectClient.top;

      if ( bToPainterRect )
      {
         rect.left += lLeft;
         rect.top += lTop;
         rect.right += lLeft;
         rect.bottom += lTop;
      }
      else
      {
         rect.left -= lLeft;
         rect.top -= lTop;
         rect.right -= lLeft;
         rect.bottom -= lTop;
      }

#ifdef DEBUG_ALL
      TraceRect( "TZNotePage::AdjustCtrlRect2", rect );
#endif
   }

   return( m_pCtrlParent );
}
コード例 #25
0
ファイル: TzCtlTAB.cpp プロジェクト: DeegC/10d
void
TZNoteBook::EndPaint( )
{
   if ( mIs_hWnd( m_hWnd ) )
   {
      CString cs = "Sel." + m_csTag;
      zLONG lCurrSel = GetProfileNbr( m_pPainterWindow->m_vDialog, "Design",
                                      m_pPainterWindow->m_csDlgTag,
                                      m_pPainterWindow->m_csWndTag, cs );
#ifdef DEBUG_ALL
      TraceLineI( "TZNoteBook::EndPaint: ", lCurrSel );
#endif

      m_bInitialized = TRUE;
      SetCurSel( 0 );
      PostMoveCtrl( );

      SetVisibility( 0x0100, -1, 1 );  // set all children invisible
      SetVisibility( 0x0101, 0, -1 );  // set self (only) visible/selectable

      if ( m_pCtrlCover )
         m_pCtrlCover->SetWindowPos( 0, 0, 0, 0, 0,
                                     SWP_NOSIZE | SWP_NOMOVE | SWP_NOREDRAW |
                                       SWP_NOZORDER | SWP_HIDEWINDOW );

      Invalidate( );
      if ( lCurrSel > 0 )
         ActivateTab( (zSHORT) lCurrSel );
      else
         ActivateTab( 1 );

      UpdateWindow( );
   }

// if ( m_pCtrlCover )
//    m_pCtrlCover->SetWindowPos( 0, 0, 0, 0, 0,
//                                SWP_NOSIZE | SWP_NOMOVE | SWP_NOREDRAW |
//                                   SWP_NOZORDER | SWP_SHOWWINDOW );
}
コード例 #26
0
ファイル: ZdCtlHot.cpp プロジェクト: DeegC/10d
void
CHyperLink::SetFont( CFont *pFont )
{
   ASSERT( mIs_hWnd( GetSafeHwnd( ) ) );
   ASSERT( pFont );

   // Set the window font and adjust its size while the window
   // is kept hidden in order to allow dynamic modification.
   ShowWindow( SW_HIDE );          // hide window
   LOGFONT lf;

   // Create the new font
   pFont->GetLogFont( &lf );
   m_Font.DeleteObject( );
   m_Font.CreateFontIndirect( &lf );

   // Call the base class SetFont( )
   CStatic::SetFont( &m_Font );

   // Resize the control if necessary
   AdjustWindow( );
   ShowWindow( SW_SHOW );          // show window
}
コード例 #27
0
ファイル: ZdCtl.cpp プロジェクト: DeegC/ZeidonTools
// Recursive routine to enable child ctrls.
void
fnEnableChildCtrls( ZMapAct *pzma, zBOOL bEnable, zBOOL bProcessChildren )
{
   WPARAM wParam = (bEnable ? 1 : 0) + 2;
   pzma->m_pZSubtask->
       m_pZMIXCtrl->VisitInorder( (fnVISIT_INORDER) fnEnableChildCtrlRecursive,
                                  0, wParam, (LPARAM) pzma );

   if ( bProcessChildren && mIs_hWnd( pzma->m_pCtrl->m_hWnd ) )
   {
   // if ( zstrcmp( "CBAdmissionsTrack", *(pzma->m_pzsTag) ) == 0 )
   //    TraceLineS( "", "" );

      if ( bEnable )
      {
         if ( pzma->m_ulMapActFlags & zMAPACT_ENABLED )
            pzma->m_pCtrl->EnableWindow( TRUE );
      }
      else
      {
         pzma->m_pCtrl->EnableWindow( FALSE );
      }
   }
}
コード例 #28
0
ファイル: ZdCtlMLE.cpp プロジェクト: DeegC/ZeidonTools
zSHORT
ZMLE::LimitTextLength( zULONG ulTextLth )
{
#ifdef DEBUG_ALL
   TraceLineS( "ZMLE::LimitTextLength: ", *m_pzsTag );
#endif
   if ( ulTextLth >= 0 )
   {
      m_ulLth = ulTextLth;
      if ( mIs_hWnd( m_hWnd ) )
         SetLimitText( m_ulLth );

#ifdef zREMOTE_SERVER
      zCHAR szTextLth[ 32 ];

      zltoa( ulTextLth, szTextLth );
      SetRemoteZCtrlAttribute( this, "MLE", "TextLth", szTextLth );
#endif

      return( 0 );
   }

   return( 1 );
}
コード例 #29
0
ファイル: ZdCtlChk.cpp プロジェクト: arksoftgit/10c
zBOOL
ZCheckBox::HandleQuickKey( zACCEL_DEF ad )
{
#ifdef DEBUG_ALL
   TraceLineS( "ZCheckBox::HandleQuickKey ", *m_pzsTag );
#endif

   if ( ad.fAlt && ad.uVK == m_chQuickKey )
   {
      if ( (m_ulMapActFlags & zMAPACT_VISIBLE) &&
           (m_ulMapActFlags & zMAPACT_ENABLED) &&
           (m_ulMapActFlags & zMAPACT_FOCUS_ENABLED) &&
           (mIs_hWnd( m_hWnd )) )
      {
         SetFocus( );
         SendMessage( WM_LBUTTONDOWN );
         SendMessage( WM_LBUTTONUP );
      }

      return( TRUE );
   }

   return( FALSE );
}
コード例 #30
0
ファイル: ZdCtlMLE.cpp プロジェクト: DeegC/ZeidonTools
zLONG
ZMLE::SetZCtrlState( zLONG  lStatusType,
                     zULONG ulValue )
{
   // We want to do something different for multiline edit controls.
   // As opposed to edit controls, it is OK to set the state of the MLE
   // control to ReadOnly when it is disabled so that is can receive
   // focus and scroll as necessary.
   if ( lStatusType != zCONTROL_STATUS_ENABLED &&
        lStatusType != zCONTROL_STATUS_AUTOGRAY )
   {
      return( ZMapAct::SetZCtrlState( lStatusType, ulValue ) );
   }

   zBOOL bEnabledPrev = (m_ulMapActFlags & zMAPACT_ENABLED) ? TRUE : FALSE;

   if ( lStatusType == zCONTROL_STATUS_ENABLED )
   {
      // Shut off auto enabled flag ... user is overriding enabled status.
      m_ulMapActFlags &= ~zMAPACT_AUTO_DISABLED;
      if ( ulValue )
         m_ulMapActFlags |= zMAPACT_ENABLED;
      else
         m_ulMapActFlags &= ~zMAPACT_ENABLED;
   }
   else
   if ( lStatusType == zCONTROL_STATUS_AUTOGRAY )
   {
      if ( ulValue )
      {
         // We can't auto-enable a control that was manually disabled.
         if ( m_ulMapActFlags & zMAPACT_AUTO_DISABLED )
         {
            m_ulMapActFlags |= zMAPACT_ENABLED;
            m_ulMapActFlags &= ~zMAPACT_AUTO_DISABLED;
         }
      }
      else
      {
         // We can't auto-disable a control that was manually disabled.
         if ( m_ulMapActFlags & zMAPACT_ENABLED )
         {
            m_ulMapActFlags &= ~zMAPACT_ENABLED;
            m_ulMapActFlags |= zMAPACT_AUTO_DISABLED;
         }
      }
   }

   zBOOL bEnabled = (m_ulMapActFlags & zMAPACT_ENABLED) ? TRUE : FALSE;
   if ( bEnabled == TRUE && bEnabledPrev == FALSE ||
        bEnabled == FALSE && bEnabledPrev == TRUE )
   {
      bEnabled = !bEnabled;     // for SetReadOnly and for return value
#ifdef zREMOTE_SERVER
      SetRemoteZCtrlAttribute( this, "Ctrl", "Enabled",
                               bEnabled ? "N" : "Y" );
      SetRemoteZCtrlAttribute( this, "Ctrl", "ReadOnly",
                               bEnabled ? "Y" : "N" );
#else
      if ( mIs_hWnd( m_hWnd ) )
      {
         SetReadOnly( bEnabled );
         Invalidate( TRUE );
      }
#endif
   }

   return( bEnabled );
}