Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - BUG: DropDown button in constraint edit wrong
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

BUG: DropDown button in constraint edit wrong

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 991
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: BUG: DropDown button in constraint edit wrong
    Posted: 01 June 2017 at 11:01am
Hi;

Take a look at the attached screenshot!
The drop down button is overlapped by the edit (text) part of the item when in edit mode:



The real value for the selected item is 0,1 (German 0.1).

I create the column in this way:
 

  TheColumn=AddColumn(new CXTPReportColumn(Column++, L"Sample Rate", 75, TRUE, XTP_REPORT_NOICON, TRUE, TRUE));   
  TheColumn->SetHeaderAlignment(xtpColumnTextRight);
  TheColumn->SetAlignment(xtpColumnTextRight);

  TheColumn->GetEditOptions()->m_bConstraintEdit=TRUE;
  TheColumn->GetEditOptions()->AddComboButton(TRUE);

  std::wostringstream oss;
  for (size_t i=0; i<sizeof(ValidSampleRates)/sizeof(ValidSampleRates[0]); i++) {
    oss.str(L""); 
    oss << std::setprecision(ValidSampleRates<1?1:0) << std::fixed << ValidSampleRates;
    TheColumn->GetEditOptions()->AddConstraint(oss.str().c_str(), i);
  }

The item itself is a CXTPReportRecordItemText instance with the string set to the shown value of 0,1.

Is it a problem of the alignment?

I'm using in this case v17.3 in VS2008.

Any help is welcome!


Martin

Product: Xtreme Toolkit v 15.3.1, new Projects v 17.2
Platform: Windows 8.1 (64bit)
Language: VC++ 2015 Upd3
Back to Top
olebed View Drop Down
Admin Group
Admin Group
Avatar

Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 567
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 01 June 2017 at 12:30pm
Hello Martin,

I can't understand how you get such  drop down button.
I can get only old-style  button.
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 991
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 02 June 2017 at 1:23am
The app is skinned using Office 2010 black style! Perhaps thats the reason...

Here is the code how I initialize the control within the OnInitDialog() function:

  SetTheme(xtpReportThemeResource);
  GetToolTipContext()->SetStyle(xtpToolTipResource);
  SetImageList(&Images_);

  SetGridStyle(FALSE, xtpReportGridNoLines);
  SetGridStyle(TRUE, xtpReportGridNoLines);

  AllowEdit(TRUE);
  SetMultipleSelection(FALSE);

  GetReportHeader()->SetAutoColumnSizing(FALSE);
  GetReportHeader()->AllowColumnRemove(FALSE);
  GetReportHeader()->AllowColumnReorder(FALSE);


I do NOTHING special and the item itself is a CXTPReportRecordItemText() instance.

I can reproduce it in any column of other report controls too. The button seems transparent.
Martin

Product: Xtreme Toolkit v 15.3.1, new Projects v 17.2
Platform: Windows 8.1 (64bit)
Language: VC++ 2015 Upd3
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 991
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 02 June 2017 at 1:51am
Hi;

I made a few more tests and after removing skinning from the application

  std::wstring StylesPath=GetModuleDirectory();
  StylesPath.append(L"Styles\\Office2010.cjstyles");

  if (XTPSkinManager()->LoadSkin(StylesPath.c_str(), L"NormalBlack.ini"))
    XTPSkinManager()->SetApplyOptions(xtpSkinApplyFrame | xtpSkinApplyColors | xtpSkinApplyMetrics | xtpSkinApplyMenus);


the old combo button appeared. So it's a skinning related bug!
The combination of skinning and AddComboButton(Inside=TRUE) leads to the drawing problem!
Setting the parameter to FALSE has no effect in my case, because its the last column of the control and therefore the button is still drawn inside the item area.

But now I have another problem!

As soon as I click onto the combo button the edit part of the item disappears (is cleared)! Why?
Here's a screenshot of this unwanted behaviour:



When I then select an item in the list the list is closed but the item stays empty. When I then change the selection to another record, the text of the new selected item is drawn. Strange!

Therefore I need a fix for two problems:
  1. Button behaviour when skinning is enabled.
  2. Cleareditem text part when combo button is pressed.

TIA

Martin

Product: Xtreme Toolkit v 15.3.1, new Projects v 17.2
Platform: Windows 8.1 (64bit)
Language: VC++ 2015 Upd3
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 991
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 02 June 2017 at 2:36am
Hello;

I can reproduce the bug using your report sample -> Quality assurace -> ComboBox
Turn on skinning (View > Skin Framework > Office 2010) then go to Report Control > Quality Assurance ComboBox. Don't turn on "Show non-active inplace buttons"!
Resize the first column that its almost the same size as the text itself. Now click into the item and voilá you see the transparent button overlapping the text and artefacts on the right side of the item area.

 
Martin

Product: Xtreme Toolkit v 15.3.1, new Projects v 17.2
Platform: Windows 8.1 (64bit)
Language: VC++ 2015 Upd3
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.125 seconds.