Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » ExtentPercentSet bug Collapse All
Subject Author Date
tera tera Oct 26, 2009 - 1:41 AM

Hello.


I widen a message column to the right side of the grid.

Display becomes abnormal afterwards when I return a message column to the left.


http://ifreeta.dee.cc/20091026/Untitled.html


switch ( iCnt ){ case EITEM_CHK: case EITEM_NO: case EITEM_TYPE: case EITEM_KAISETU:  pMuGridCellHeader1->ExtentPercentSet( 0.0 );  break; case EITEM_MES:  pMuGridCellHeader1->ExtentPercentSet( 1.0 );  break; }


Had better the sample source prepare, too?

Technical Support Oct 27, 2009 - 2:32 PM

Please try this improved version:

INT nCurrentItemExtent; // THIS LINE WAS ADDED
pMuGridCellHeader1->ExtentGet( nCurrentItemExtent, 0 ); // THIS LINE WAS ADDED

switch ( iCnt ){
  case EITEM_CHK:
  case EITEM_NO:
  case EITEM_TYPE:
  case EITEM_KAISETU:
   pMuGridCellHeader1->ExtentPercentSet( 0.0 );
   pMuGridCellHeader1->ExtentSet( nCurrentItemExtent, -1 ); // THIS LINE WAS ADDED
   pMuGridCellHeader1->ExtentSet( nCurrentItemExtent, +1 ); // THIS LINE WAS ADDED
   break;
  case EITEM_MES:
   pMuGridCellHeader1->ExtentPercentSet( 1.0 );
   break;
  }
}


tera tera Oct 27, 2009 - 8:49 PM

 


The program worked normally.

However, I was not able to coordinate the width of the cell........


I assume it completion first of all.


Thank you.

Technical Support Oct 26, 2009 - 2:18 PM

Please specify the equal minimal/current/maximal pixel width for all the non-scaled columns in your grid window using the CExtGridCell::ExtentSet() method.



tera tera Oct 26, 2009 - 6:54 PM

//----------------------------------------------------- /**  * @brief  */ //----------------------------------------------------- void CNxfErrorListSelGrid::InitGrid() {  ASSERT_VALID( this );  ASSERT( GetSafeHwnd() != NULL && ::IsWindow(GetSafeHwnd()) );

 MgdGroupSetUp();

 LOGFONT lf; // Used to create the CFont.  memset(&lf, 0, sizeof(LOGFONT));   // Clear out structure.  strcpy(lf.lfFaceName, "MS ゴシック");

 lf.lfHeight   = 12;  lf.lfWeight   = FW_NORMAL;  lf.lfOutPrecision = OUT_DEFAULT_PRECIS;  lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;  lf.lfQuality  = DEFAULT_QUALITY;  lf.lfCharSet  = SHIFTJIS_CHARSET;  lf.lfPitchAndFamily = FIXED_PITCH;    m_font.CreateFontIndirect(&lf);

 SetFont(&m_font);

 lf.lfHeight   = 10;  m_fontButton.CreateFontIndirect(&lf);

 //------------------------------------  SiwModifyStyle(   0   |__ESIS_STH_NONE      |__ESIS_STV_ITEM   |__EGBS_SFM_FULL_ROWS      |__EGBS_RESIZING_CELLS_OUTER_H    |__EGBS_SF_SELECT_OUTER_ROWS    |__EGBS_SUBTRACT_SEL_AREAS     |__EGBS_DYNAMIC_RESIZING   |__EGBS_MULTI_AREA_SELECTION    |__EGBS_NO_HIDE_SELECTION   |__EGBS_GRIDLINES   |__EGBS_LBEXT_SELECTION   ,   0   ,   false   );

 //------------------------------------  SiwModifyStyleEx(   0   |__EGBS_EX_CELL_TOOLTIPS_OUTER     |__EGBS_EX_CORNER_AREAS_CURVE   ,   0,   false   );

 BseModifyStyle(     __EGWS_BSE_SORT_MULTIPLE_COLUMNS   | __EGWS_BSE_BUTTONS_IN_FOCUSED_CELL   | __EGWS_BSE_BUTTONS_IN_FOCUSED_ROW   | __EGWS_BSE_BUTTONS_IN_HOVERED_CELL   | __EGWS_BSE_BUTTONS_IN_HOVERED_ROW   | __EGWS_BSE_BUTTONS_IN_SELECTED_CELLS   | __EGWS_BSE_BUTTONS_IN_SELECTED_ROW   ,    __EGWS_BSE_DEFAULT       ,   false   );  //------------------------------------  BseModifyStyleEx(   __EGBS_BSE_EX_DRAG_COLUMNS   |__EGBS_BSE_EX_HIGHLIGHT_PRESSING_COLUMNS_OUTER      | __EGBS_BSE_EX_DBLCLK_BEST_FIT_COLUMN_MEASURE_INNER    | __EGBS_BSE_EX_DBLCLK_BEST_FIT_AVAILABLE   | __EGBS_BSE_EX_DBLCLK_BEST_FIT_COLUMN_MEASURE_OUTER    |__EGBS_BSE_EX_PROPORTIONAL_COLUMN_WIDTHS   ,   __EGWS_BSE_EX_DEFAULT     ,   false  );

 RowRemoveAll  ( false );  ColumnRemoveAll  ( false );

 // カラム初期設定  OuterRowCountTopSet  ( 1L, false );

 OuterColumnCountLeftSet ( 1L, false );  OuterColumnWidthSet  ( true, 0, 20 );

 OuterTitleMake();

 BestFitColumnAll();

 ModifyStyle( 0, WS_CLIPCHILDREN | WS_CLIPSIBLINGS ); }

int  CNxfErrorListSelGrid::_ColMax() {  return 5; }

void CNxfErrorListSelGrid::OuterTitleMake() {  CExtGridCellHeader *pMuGridCellHeader1;  int iCol = 0;

 // カラム数を設定  ColumnAdd ( _ColMax() , false);

 /// タイトル  CString  csStr;  int   iCnt;  int   iSize;

 iSize = 50;  bool blFlag = false;  for ( iCnt = 0 ; iCnt < _ColMax() ; iCnt++ ){   blFlag = true;

  switch ( iCnt ){   case EITEM_CHK:    iSize = 8;    break;   case EITEM_NO:    iSize = 15;    break;   case EITEM_TYPE:    iSize = 30;    break;   case EITEM_MES:    iSize = 400;    blFlag = false;    break;   case EITEM_KAISETU:    iSize = 40;    break;   }

  pMuGridCellHeader1 = STATIC_DOWNCAST( CExtGridCellHeader, GridCellGetOuterAtTop(  iCnt ,  0 ,  RUNTIME_CLASS(CExtGridCellHeader)  ) );   pMuGridCellHeader1->ExtentSet ( iSize );   pMuGridCellHeader1->TextSet( csStr );   pMuGridCellHeader1->ModifyStyle( __EGCS_TA_HORZ_CENTER );

  //   switch ( iCnt ){   case EITEM_CHK:   case EITEM_NO:   case EITEM_TYPE:   case EITEM_KAISETU:    pMuGridCellHeader1->ExtentPercentSet( 0.0 );    break;   case EITEM_MES:    pMuGridCellHeader1->ExtentPercentSet( 1.0 );    break;   }  }

}

 


 


Is the necessary information good only in this? 


 

tera tera Oct 26, 2009 - 6:39 PM

It reappears when I click a non-client area.


http://ifreeta.dee.cc/20091027/Untitled13.html