Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Expand button and edit control.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Expand button and edit control.

 Post Reply Post Reply
Author
Message
Sudhakar View Drop Down
Newbie
Newbie


Joined: 17 February 2009
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sudhakar Quote  Post ReplyReply Direct Link To This Post Topic: Expand button and edit control.
    Posted: 18 February 2009 at 7:21am

Hi!

How can we show the expand button in the report control cell when the AllowEdit is FALSEl? Or
How can I hide the edit control when the AllowEdit is TRUE and just show expand button?
 
 
My requirement is below:
 
I want to display an expand button in a cell of report control and when this button is pressed, then it invokes a dialog which contains the controls to select line color,style and width. Once the selection of these attributes is done and clicked "OK" button of this dialog, then I want to draw a line in the report control cell with selected color, style and thickness.
 
I am able to show expand button when AllowEdit is TRUE. But this also shows a edit control  along with expand button when the cell is clicked. As the result if there is any line drawing in the current cell, then that line is being covered by the edit control. So I want to hide the edit control as it is not necessary in this scenario.
 
 
Please provide some suggestions/hints.
 
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 21 February 2009 at 12:11am
Try to SetInplaceCellButton(TRUE) make cell size equal button size.
Example of setting (ReportSample - TaskListView:

int CTaskListView::OnCreate(LPCREATESTRUCT lpCreateStruct)

{

.......................

//HOW TO SET BUTTON INSIDE CELL <<

int iAiB0 = pColumnImportance->GetEditOptions()->arrInplaceButtons.GetCount();

CXTPReportInplaceButton* pBtn0 = pColumnImportance->GetEditOptions()->arrInplaceButtons.GetAt(iAiB0 - 1);

pBtn0->SetInsideCellButton(TRUE);

pColumnDueDate->GetEditOptions()->m_bAllowEdit = FALSE;

pColumnDueDate->GetEditOptions()->AddComboButton();

int iAiB1 = pColumnDueDate->GetEditOptions()->arrInplaceButtons.GetCount();

CXTPReportInplaceButton* pBtn1 = pColumnDueDate->GetEditOptions()->arrInplaceButtons.GetAt(iAiB1 - 1);

pBtn1->SetInsideCellButton(TRUE);

pColumnPercent->GetEditOptions()->m_bAllowEdit = FALSE;

pColumnPercent->GetEditOptions()->m_bConstraintEdit = TRUE;

pColumnPercent->GetEditOptions()->AddSpinButton();

int iAiB2 = pColumnPercent->GetEditOptions()->arrInplaceButtons.GetCount();

CXTPReportInplaceButton* pBtn2 = pColumnPercent->GetEditOptions()->arrInplaceButtons.GetAt(iAiB2 - 1);

pBtn2->SetInsideCellButton(TRUE);

pBtn2->SetSpinButtonStep(10);

//HOW TO SET BUTTON INSIDE CELL >>

...................
}
Back to Top
Sudhakar View Drop Down
Newbie
Newbie


Joined: 17 February 2009
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sudhakar Quote  Post ReplyReply Direct Link To This Post Posted: 26 February 2009 at 6:39am
Thank you mdoubson for the help. It t works fine, but this is generating XTP_NM_REPORT_INPLACEBUTTONDOWN message as soon as I click on the cell that contain this expand button. Hence the dialobox which I am dispalying in this event is being displayed. I would like to display the dialog box only when I click on the expand  button. I would like to display button first on the click of cell, then on the click of button I want to show the dialog box(cell should not go into edit mode). Please let me know if you have suggestion.
 
Regards,
Sudhakar S.  
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 03 April 2009 at 12:13am
In 13.1 I modified functions
 
GetEditOptions()->AddComboButton(TRUE); //default FALSE - means not Set Inside Cell, TRUE - Set Inside Cell

GetEditOptions()->AddSpinButton(TRUE); //same thing

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.