예제 #1
0
void COptionTree::EnsureVisible(COptionTreeItem *otiItem)
{
	// Declare variables
	COptionTreeItem* otiParent;
	CRect rcClient;
	CPoint ptPoint;
	long lOY;
	
	// Make sure valid
	if (otiItem == NULL)
	{
		return;
	}

	// Item is not scroll visible (expand all parents)
	if (IsItemVisible(otiItem) == FALSE)
	{
		otiParent = otiItem->GetParent();
		while (otiParent != NULL)
		{
			otiParent->Expand();
			
			otiParent = otiParent->GetParent();
		}

		UpdatedItems();
		UpdateWindow();
	}

	// Item should be visible
	if (IsItemVisible(otiItem) == FALSE)
	{
		return;
	}

	// Calculate list client rectangle
	m_otlList.GetClientRect(rcClient);
	rcClient.OffsetRect(0, m_ptOrigin.y);
	rcClient.bottom -= otiItem->GetHeight();

	// Get item location
	ptPoint = otiItem->GetLocation();
	//when the item is at the end will get a bug ,so avoid it
	ptPoint.y -= 2;
	if (!rcClient.PtInRect(ptPoint))
	{
		if (ptPoint.y < rcClient.top)
		{
			lOY = ptPoint.y;
		}
		else
		{
			lOY = ptPoint.y - rcClient.Height() + otiItem->GetHeight();
		}

		m_otlList.OnVScroll(SB_THUMBTRACK, lOY, NULL);
	}
}
예제 #2
0
void COptionTreeList::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) 
{
	// Declare variables
	COptionTreeItem* otiItem;
	CRect rcClient;

	// Get client rectangle
	GetClientRect(rcClient);

	// Validate option
	if (m_otOption == NULL)
	{
		CWnd::OnKeyDown(nChar, nRepCnt, nFlags);
		return;
	}

	// See if disabled
	if (m_otOption->IsDisableInput() || !m_otOption->IsWindowEnabled())
	{
		CWnd::OnKeyDown(nChar, nRepCnt, nFlags);
		return;
	}

	switch (nChar)
	{
		case VK_TAB:

			// -- Shift
			if (GetKeyState(VK_SHIFT) < 0)
			{
				// -- -- Focus next
				otiItem = m_otOption->GetFocusedItem();
				if (otiItem != NULL && !otiItem->IsRootLevel())
				{
					m_otOption->FocusPrev();
				}

				// -- -- Activate
				otiItem = m_otOption->GetFocusedItem();
				if (otiItem != NULL && !otiItem->IsRootLevel() && !otiItem->IsReadOnly())
				{
					otiItem->Activate();
				}

				Invalidate();

				UpdateWindow();
			}
			// -- No shift
			else
			{
				// -- -- Focus next
				otiItem = m_otOption->GetFocusedItem();
				if (otiItem != NULL && !otiItem->IsRootLevel())
				{
					m_otOption->FocusNext();
				}

				// -- -- Activate
				otiItem = m_otOption->GetFocusedItem();
				if (otiItem != NULL && !otiItem->IsRootLevel() && !otiItem->IsReadOnly())
				{
					otiItem->Activate();
				}

				Invalidate();

				UpdateWindow();
			}

			break;

		case VK_RETURN:

			// -- Activate
			otiItem = m_otOption->GetFocusedItem();
			if (otiItem != NULL && !otiItem->IsRootLevel() && !otiItem->IsReadOnly())
			{
				otiItem->Activate();
			}
			break;

		case VK_HOME:

			// -- Focus on first item
			if (m_otOption->FocusFirst())
			{
				Invalidate();

				UpdateWindow();
			}
			break;

		case VK_END:

			// -- Focus on last item
			if (m_otOption->FocusLast())
			{
				Invalidate();
				
				UpdateWindow();
			}
			break;

		case VK_LEFT:

			// -- Get focused item
			otiItem = m_otOption->GetFocusedItem();
			if (otiItem != NULL)
			{
				// -- -- Send notify to user
				if (!m_otOption->SendNotify(OT_NOTIFY_ITEMEXPANDING, otiItem))
				{
					// -- -- -- Validate
					if (otiItem->GetChild() && otiItem->IsExpanded())
					{
						// -- Expand
						otiItem->Expand(FALSE);

						// -- Update resize
						UpdateResize();

						// -- Force redraw
						Invalidate();

						// -- Update window
						UpdateWindow();

						// -- Check visible
						CheckVisibleFocus();

						break;
					}
				}
			}
			else
				break;
			
		case VK_UP:
			
			// -- Move focus up
			if (m_otOption->FocusPrev())
			{
				Invalidate();

				UpdateWindow();
			}
			break;

		case VK_RIGHT:

			// -- Get focused item
			otiItem = m_otOption->GetFocusedItem();
			if (otiItem != NULL)
			{
				// -- -- Send notify to user
				if (!m_otOption->SendNotify(OT_NOTIFY_ITEMEXPANDING, otiItem))
				{
					// -- -- -- Validate
					if (otiItem->GetChild() && !otiItem->IsExpanded())
					{
						// -- -- -- -- Expand
						otiItem->Expand(TRUE);

						// -- -- -- -- Update resize
						UpdateResize();

						// -- -- -- -- Force redraw
						Invalidate();

						// -- -- -- -- Update window
						UpdateWindow();

						// -- -- -- -- Check visible
						CheckVisibleFocus();

						break;
					}
				}
			}
			else
				break;
			
		case VK_DOWN:

			// -- Move focus down
			if (m_otOption->FocusNext())
			{
				Invalidate();

				UpdateWindow();
			}
			break;
	}
	
	CWnd::OnKeyDown(nChar, nRepCnt, nFlags);
}
예제 #3
0
void COptionTreeList::OnLButtonDblClk(UINT nFlags, CPoint point) 
{
	// Validate option
	if (m_otOption == NULL)
	{
		CWnd::OnLButtonDblClk(nFlags, point);
		return;
	}

	// See if disabled
	if (m_otOption->IsDisableInput() || !m_otOption->IsWindowEnabled())
	{
		CWnd::OnLButtonDblClk(nFlags, point);
		return;
	}

	// Declare variables
	COptionTreeItem *otiItem;
	COptionTreeItem *oliOldFocus;
	CRect rcClient, rcLabel;

	// Send notify to user
	m_otOption->SendNotify(NM_DBLCLK);

	// Get client rect
	GetClientRect(rcClient);

	// Hit test
	if ((otiItem = m_otOption->FindItem(point)) != NULL && otiItem->GetChild())
	{
		switch (m_otOption->HitTest(point))
		{
			case OT_HIT_COLUMN:

				// -- Get largest visible label
				rcLabel = m_otOption->GetLargestVisibleLabel();

				// -- Resize limit
				// -- -- Right
				if (rcLabel.right + OT_SPACE > (rcClient.right - OT_RESIZEBUFFER))
				{
					// -- -- -- Set column
					m_otOption->SetColumn(rcClient.right - OT_RESIZEBUFFER);
				}
				else
				{
					// -- -- -- Set column
					m_otOption->SetColumn(rcLabel.right + OT_SPACE);
				}

				// -- Update move items
				m_otOption->UpdateMoveAllItems();

				// -- Force redraw
				Invalidate();

				// -- Update window
				UpdateWindow();

				break;

			case OT_HIT_ATTRIBUTE:

				if (!otiItem->IsRootLevel())
				{
					break;
				}

			default:
				// -- Get focus item
				oliOldFocus = m_otOption->GetFocusedItem();

				// -- Select items
				m_otOption->SelectItems(NULL, FALSE);

				// -- Set focus item
				m_otOption->SetFocusedItem(otiItem);

				// -- Select
				otiItem->Select();
			
				// -- Send notify to user
				if (otiItem != oliOldFocus)
				{
					m_otOption->SendNotify(OT_NOTIFY_SELCHANGE, otiItem);
				}

			case OT_HIT_EXPAND:

				if (!m_otOption->SendNotify(OT_NOTIFY_ITEMEXPANDING, otiItem))
				{
					// -- Expand
					otiItem->Expand(!otiItem->IsExpanded());

					// -- Update resize
					UpdateResize();

					// -- Force redraw
					Invalidate();

					// -- Update window
					UpdateWindow();

					// -- Check visible
					CheckVisibleFocus();
				}
				break;
		}
	}
	else
	{
		switch (m_otOption->HitTest(point))
		{
			case OT_HIT_COLUMN:

				// -- Get largest visible label
				rcLabel = m_otOption->GetLargestVisibleLabel();

				// -- Resize limit
				// -- -- Right
				if (rcLabel.right + OT_SPACE > (rcClient.right - OT_RESIZEBUFFER))
				{
					// -- -- -- Set column
					m_otOption->SetColumn(rcClient.right - OT_RESIZEBUFFER);
				}
				else
				{
					// -- -- -- Set column
					m_otOption->SetColumn(rcLabel.right + OT_SPACE);
				}

				// -- Update move items
				m_otOption->UpdateMoveAllItems();

				// -- Force redraw
				Invalidate();

				// -- Update window
				UpdateWindow();

				break;
		}
	}

	CWnd::OnLButtonDblClk(nFlags, point);
}
예제 #4
0
void COptionTreeList::OnLButtonDown(UINT nFlags, CPoint point) 
{
	// Validate option
	if (m_otOption == NULL)
	{
		CWnd::OnLButtonDown(nFlags, point);
		return;
	}

	// See if disabled
	if (m_otOption->IsDisableInput() || !m_otOption->IsWindowEnabled())
	{
		CWnd::OnLButtonDown(nFlags, point);
		return;
	}

	// Send notify to user
	m_otOption->SendNotify(NM_CLICK);

	// Declare variables
	long lHit;
	COptionTreeItem *otiItem;
	COptionTreeItem *oliOldFocus;
	CRect rcClient;

	// Get client rectangle
	GetClientRect(rcClient);

	// Set focus to window
	SetFocus();

	// Hit test
	lHit = m_otOption->HitTest(point);
	switch (lHit)
	{
		case OT_HIT_COLUMN:
			
			if (m_otOption->SendNotify(OT_NOTIFY_COLUMNCLICK))
			{
				break;
			}

			// -- Set capture
			m_bColDrag = TRUE;
			SetCapture();

			m_lColumn = m_otOption->GetOrigin().x;

			// -- Force redraw
			Invalidate();

			// -- Update window
			UpdateWindow();

			break;

		case OT_HIT_EXPAND:

			if ((otiItem = m_otOption->FindItem(point)) != NULL)
			{
				if (otiItem->GetChild() && !m_otOption->SendNotify(OT_NOTIFY_ITEMEXPANDING, otiItem))
				{
					// -- Expand
					otiItem->Expand(!otiItem->IsExpanded());

					// -- Update resize
					UpdateResize();

					// -- Force redraw
					Invalidate();

					// -- Update window
					UpdateWindow();

					// -- Check visible
					CheckVisibleFocus();
				}
			}
			break;

		default:

			if ((otiItem = m_otOption->FindItem(point)) != NULL)
			{
				// -- Get old focus
				oliOldFocus = m_otOption->GetFocusedItem();

				// -- Select items
				m_otOption->SelectItems(NULL, FALSE);

				// -- Select
				otiItem->Select();

				// -- Make sure new item
				if (otiItem != oliOldFocus)
				{
					m_otOption->SendNotify(OT_NOTIFY_SELCHANGE, otiItem);
				}

				// -- Send notify
				if (lHit == OT_HIT_ATTRIBUTE && !otiItem->IsRootLevel())
				{
					if (!m_otOption->SendNotify(OT_NOTIFY_PROPCLICK, otiItem) && !otiItem->IsReadOnly())
					{
						otiItem->Activate();
					}
				}

				// -- Set focus item
				m_otOption->SetFocusedItem(otiItem);

				// -- Force redraw
				Invalidate();

				// -- Update window
				UpdateWindow();

			}
			else
			{
				// -- Select items
				m_otOption->SelectItems(NULL, FALSE);

				// -- Set focus item
				m_otOption->SetFocusedItem(NULL);

				// -- Send notify
				m_otOption->SendNotify(OT_NOTIFY_SELCHANGE);

				// -- Force redraw
				Invalidate();

				// -- Update window
				UpdateWindow();
			}
			break;
	}

	CWnd::OnLButtonDown(nFlags, point);
}
BOOL CReportLabelProperties::OnInitDialog() 

{
	CDialog::OnInitDialog();

	COptionTreeItem *otiRoot = NULL;
	COptionTreeItem *otiItem = NULL;

	CRect rcClient;
	DWORD dwStyle, dwOptions;
	LOGFONT lfFont, lfDefaultFont;

	// Get log fonts
	GetFont()->GetLogFont(&lfFont);
	GetFont()->GetLogFont(&lfDefaultFont);
	//strcpy(lfDefaultFont.lfFaceName, _T("Arial"));#OBSOLETE
	strcpy_s(lfDefaultFont.lfFaceName,sizeof(lfDefaultFont.lfFaceName), _T("Arial"));

	// Get the clients rectangle
	GetClientRect(rcClient);

	// Setup the window style
	dwStyle = WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;

	// Setup the tree options 
	// OT_OPTIONS_SHOWINFOWINDOW
	dwOptions = OT_OPTIONS_SHADEEXPANDCOLUMN | OT_OPTIONS_SHADEROOTITEMS | OT_OPTIONS_SHOWINFOWINDOW;

	int  trBot=rcClient.bottom;
	if (GetDlgItem(IDOK))
	{
		CRect rrrr;
		GetDlgItem(IDOK)->GetWindowRect(rrrr);
		ScreenToClient(rrrr);
		trBot = rrrr.top -4;
	}
	// Create tree options
	CRect trR = rcClient;
	trR.bottom = trBot;
	if (m_otTree.Create(dwStyle, trR, this, dwOptions, 1004) == FALSE)
	{
		TRACE0("Failed to create options control.\r\n");
		return FALSE;
	}

	// Want to be notified
	m_otTree.SetNotify(TRUE, this);

	CString resStr;

	// -- Edit Items
	otiRoot = m_otTree.InsertItem(new COptionTreeItem());
	resStr.LoadString(IDS_REP_LAB);
	otiRoot->SetLabelText(resStr);
	resStr.LoadString(IDS_REP_FULL_LAB);
	otiRoot->SetInfoText(resStr);

	CClientDC	dc( this );
	int inch = dc.GetDeviceCaps( LOGPIXELSX );
	double pt = static_cast< double >( inch ) / 72;

	m_otiFont = (COptionTreeItemFont*)m_otTree.InsertItem(new COptionTreeItemFont(), otiRoot);
	resStr.LoadString(IDS_REP_LAB_FONT);
	m_otiFont->SetLabelText(resStr);
	resStr.LoadString(IDS_REP_LAB_FULL_FONT);
	m_otiFont->SetInfoText(resStr);
	if (m_otiFont->CreateFontItem(&m_lf,pt))
	{
		m_otiFont->SetColor(m_color);
	}
	m_text_edit = (COptionTreeItemEdit*) m_otTree.InsertItem(new COptionTreeItemEdit(), otiRoot);
	resStr.LoadString(IDS_REP_LAB);
	m_text_edit->SetLabelText(resStr);
	m_text_edit->SetInfoText(resStr);
	if (m_text_edit->CreateEditItem(/*OT_EDIT_MULTILINE*/NULL, ES_WANTRETURN | ES_AUTOVSCROLL | ES_AUTOHSCROLL) == TRUE)
	{
		m_text_edit->SetWindowText(_T("Label"));
	}

	m_otiAngle_radio = (COptionTreeItemRadio*)m_otTree.InsertItem(new COptionTreeItemRadio(), otiRoot);
	resStr.LoadString(IDS_REPORT_TEXT_ANG);
	m_otiAngle_radio->SetLabelText(resStr);
	resStr.LoadString(IDS_REPORT_FULL_TEXT_ANG);
	m_otiAngle_radio->SetInfoText(resStr);
	if (m_otiAngle_radio->CreateRadioItem() == TRUE)
	{
		resStr.LoadString(IDS_REPORT_0_ANG);
		m_otiAngle_radio->InsertNewRadio(resStr, FALSE);
		resStr.LoadString(IDS_REPORT_90_ANG);
		m_otiAngle_radio->InsertNewRadio(resStr, FALSE);
		resStr.LoadString(IDS_REPORT_M90_ANG);
		m_otiAngle_radio->InsertNewRadio(resStr, FALSE);
		resStr.LoadString(IDS_REPORT_180_ANG);
		m_otiAngle_radio->InsertNewRadio(resStr, FALSE);
	}

	m_otiAlign_radio = (COptionTreeItemRadio*)m_otTree.InsertItem(new COptionTreeItemRadio(), otiRoot);
	resStr.LoadString(IDS_REP_LAB_ALIGN);
	m_otiAlign_radio->SetLabelText(resStr);
	resStr.LoadString(IDS_REP_LAB_FULL_ALIGN);
	m_otiAlign_radio->SetInfoText(resStr);
	if (m_otiAlign_radio->CreateRadioItem() == TRUE)
	{
		resStr.LoadString(IDS_REP_LAB_ALIGN_L);
		m_otiAlign_radio->InsertNewRadio(resStr, FALSE);
		resStr.LoadString(IDS_REP_LAB_ALIGN_C);
		m_otiAlign_radio->InsertNewRadio(resStr, FALSE);
		resStr.LoadString(IDS_REP_LAB_ALIGN_R);
		m_otiAlign_radio->InsertNewRadio(resStr, FALSE);
	}
	

	otiRoot->Expand();

	otiRoot = m_otTree.InsertItem(new COptionTreeItem());
	resStr.LoadString(IDS_REP_PR_DL_FRAME);
	otiRoot->SetLabelText(resStr);
	resStr.LoadString(IDS_REP_PR_DL_FULL_FRAME);
	otiRoot->SetInfoText(resStr);

	CString yesS;
	yesS.LoadString(IDS_YES);
	CString noS;
	noS.LoadString(IDS_NO);

	m_otiExistLeft = (COptionTreeItemCheckBox*)m_otTree.InsertItem(new COptionTreeItemCheckBox(), otiRoot);
	resStr.LoadString(IDS_REP_PR_DL_LEFT);
	m_otiExistLeft->SetLabelText(resStr);
	resStr.LoadString(IDS_REP_PR_DL_FULL_LEFT);
	m_otiExistLeft->SetInfoText(resStr);
	if (m_otiExistLeft->CreateCheckBoxItem(m_borderStyle&DIAGRAM_FRAME_STYLE_LEFT, OT_CHECKBOX_SHOWCHECK) == TRUE)
	{
		m_otiExistLeft->SetCheckText(yesS, noS);
	}
	m_otiExistRight = (COptionTreeItemCheckBox*)m_otTree.InsertItem(new COptionTreeItemCheckBox(), otiRoot);
	resStr.LoadString(IDS_REP_PR_DL_RIGHT);
	m_otiExistRight->SetLabelText(resStr);
	resStr.LoadString(IDS_REP_PR_DL_FULL_RIGHT);
	m_otiExistRight->SetInfoText(resStr);
	if (m_otiExistRight->CreateCheckBoxItem(m_borderStyle&DIAGRAM_FRAME_STYLE_RIGHT, OT_CHECKBOX_SHOWCHECK) == TRUE)
	{
		m_otiExistRight->SetCheckText(yesS, noS);
	}
	m_otiExistTop = (COptionTreeItemCheckBox*)m_otTree.InsertItem(new COptionTreeItemCheckBox(), otiRoot);
	resStr.LoadString(IDS_REP_PR_DL_TOP);
	m_otiExistTop->SetLabelText(resStr);
	resStr.LoadString(IDS_REP_PR_DL_FULL_TOP);
	m_otiExistTop->SetInfoText(resStr);
	if (m_otiExistTop->CreateCheckBoxItem(m_borderStyle&DIAGRAM_FRAME_STYLE_TOP, OT_CHECKBOX_SHOWCHECK) == TRUE)
	{
		m_otiExistTop->SetCheckText(yesS, noS);
	}
	m_otiExistBottom = (COptionTreeItemCheckBox*)m_otTree.InsertItem(new COptionTreeItemCheckBox(), otiRoot);
	resStr.LoadString(IDS_REP_PR_DL_BOTTOM);
	m_otiExistBottom->SetLabelText(resStr);
	resStr.LoadString(IDS_REP_PR_DL_FULL_BOTTOM);
	m_otiExistBottom->SetInfoText(resStr);
	if (m_otiExistBottom->CreateCheckBoxItem(m_borderStyle&DIAGRAM_FRAME_STYLE_BOTTOM, OT_CHECKBOX_SHOWCHECK) == TRUE)
	{
		m_otiExistBottom->SetCheckText(yesS, noS);
	}
	m_otiFrameColorCombo = (COptionTreeItemColorComboBox*)m_otTree.InsertItem(new COptionTreeItemColorComboBox(), otiRoot);
	resStr.LoadString(IDS_PER_PR_DL_COL_FR);
	m_otiFrameColorCombo->SetLabelText(resStr);
	resStr.LoadString(IDS_PER_PR_DL_FULL_COL_FR);
	m_otiFrameColorCombo->SetInfoText(resStr);
	if (m_otiFrameColorCombo->CreateComboItem(NULL) == TRUE)
	{
		m_otiFrameColorCombo->SetCurColor(m_borderColor);	
	}
	m_otiFrameThicknessCombo = (COptionTreeItemLineThikComboBox*)m_otTree.InsertItem(new COptionTreeItemLineThikComboBox(), otiRoot);
	resStr.LoadString(IDS_PER_PR_DL_TH_FR);
	m_otiFrameThicknessCombo->SetLabelText(resStr);
	resStr.LoadString(IDS_PER_PR_DL_FULL_TH_FR);
	m_otiFrameThicknessCombo->SetInfoText(resStr);
	if (m_otiFrameThicknessCombo->CreateComboItem(NULL) == TRUE)
	{
		m_otiFrameThicknessCombo->SetLineThickness(m_borderThickness);
	}

	otiRoot->Expand();

	return TRUE;
}
BOOL CReportPictureProperties::OnInitDialog() 
/* ============================================================
	Function :		CReportPictureProperties::OnInitDialog
	Description :	Handler for the "WM_INITDIALOG" messag
	Access :		Protected

	Return :		BOOL	-	Always "TRUE"
	Parameters :	none

	Usage :			Called from MFC

   ============================================================*/
{
	CDialog::OnInitDialog();

	COptionTreeItem *otiRoot = NULL;
	COptionTreeItem *otiItem = NULL;

	CRect rcClient;
	DWORD dwStyle, dwOptions;
	LOGFONT lfFont, lfDefaultFont;

	// Get log fonts
	GetFont()->GetLogFont(&lfFont);
	GetFont()->GetLogFont(&lfDefaultFont);
	//strcpy(lfDefaultFont.lfFaceName, _T("Arial"));#OBSOLETE
	strcpy_s(lfDefaultFont.lfFaceName,sizeof(lfDefaultFont.lfFaceName), _T("Arial"));

	// Get the clients rectangle
	GetClientRect(rcClient);

	// Setup the window style
	dwStyle = WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;

	// Setup the tree options 
	// OT_OPTIONS_SHOWINFOWINDOW
	dwOptions = OT_OPTIONS_SHADEEXPANDCOLUMN | OT_OPTIONS_SHADEROOTITEMS | OT_OPTIONS_SHOWINFOWINDOW;

	int  trBot=rcClient.bottom;
	if (GetDlgItem(IDOK))
	{
		CRect rrrr;
		GetDlgItem(IDOK)->GetWindowRect(rrrr);
		ScreenToClient(rrrr);
		trBot = rrrr.top -4;
	}
	// Create tree options
	CRect trR = rcClient;
	trR.bottom = trBot;
	if (m_otTree.Create(dwStyle, trR, this, dwOptions, 1004) == FALSE)
	{
		TRACE0("Failed to create options control.\r\n");
		return FALSE;
	}

	// Want to be notified
	m_otTree.SetNotify(TRUE, this);

	// -- Edit Items
	CString resStr;
	otiRoot = m_otTree.InsertItem(new COptionTreeItem());
	resStr.LoadString(IDS_REP_COMMON_PROPS);
	otiRoot->SetLabelText(resStr);
	resStr.LoadString(IDS_REP_FULL_COMMON_PROPS);
	otiRoot->SetInfoText(resStr);

	m_otiFile = (COptionTreeItemFile*)m_otTree.InsertItem(new COptionTreeItemFile(), otiRoot);
	resStr.LoadString(IDS_REP_PR_FILE);
	m_otiFile->SetLabelText(resStr);
	resStr.LoadString(IDS_REP_PR_FULL_FILE);
	m_otiFile->SetInfoText(resStr);
	if (m_otiFile->CreateFileItem("",GetExtFromType(0).Mid(2,3),GetFileTypes(TRUE),
							OT_FILE_OPENDIALOG | OT_FILE_SHOWFULLPATH, 
							OFN_OVERWRITEPROMPT|OFN_HIDEREADONLY | OFN_FILEMUSTEXIST) == TRUE)
	{
	}

	otiRoot->Expand();

	otiRoot = m_otTree.InsertItem(new COptionTreeItem());
	resStr.LoadString(IDS_REP_PR_DL_FRAME);
	otiRoot->SetLabelText(resStr);
	resStr.LoadString(IDS_REP_PR_DL_FULL_FRAME);
	otiRoot->SetInfoText(resStr);

	CString yesS;
	yesS.LoadString(IDS_YES);
	CString noS;
	noS.LoadString(IDS_NO);

	m_otiExistLeft = (COptionTreeItemCheckBox*)m_otTree.InsertItem(new COptionTreeItemCheckBox(), otiRoot);
	resStr.LoadString(IDS_REP_PR_DL_LEFT);
	m_otiExistLeft->SetLabelText(resStr);
	resStr.LoadString(IDS_REP_PR_DL_FULL_LEFT);
	m_otiExistLeft->SetInfoText(resStr);
	if (m_otiExistLeft->CreateCheckBoxItem(m_borderStyle&DIAGRAM_FRAME_STYLE_LEFT, OT_CHECKBOX_SHOWCHECK) == TRUE)
	{
		m_otiExistLeft->SetCheckText(yesS, noS);
	}
	m_otiExistRight = (COptionTreeItemCheckBox*)m_otTree.InsertItem(new COptionTreeItemCheckBox(), otiRoot);
	resStr.LoadString(IDS_REP_PR_DL_RIGHT);
	m_otiExistRight->SetLabelText(resStr);
	resStr.LoadString(IDS_REP_PR_DL_FULL_RIGHT);
	m_otiExistRight->SetInfoText(resStr);
	if (m_otiExistRight->CreateCheckBoxItem(m_borderStyle&DIAGRAM_FRAME_STYLE_RIGHT, OT_CHECKBOX_SHOWCHECK) == TRUE)
	{
		m_otiExistRight->SetCheckText(yesS, noS);
	}
	m_otiExistTop = (COptionTreeItemCheckBox*)m_otTree.InsertItem(new COptionTreeItemCheckBox(), otiRoot);
	resStr.LoadString(IDS_REP_PR_DL_TOP);
	m_otiExistTop->SetLabelText(resStr);
	resStr.LoadString(IDS_REP_PR_DL_FULL_TOP);
	m_otiExistTop->SetInfoText(resStr);
	if (m_otiExistTop->CreateCheckBoxItem(m_borderStyle&DIAGRAM_FRAME_STYLE_TOP, OT_CHECKBOX_SHOWCHECK) == TRUE)
	{
		m_otiExistTop->SetCheckText(yesS, noS);
	}
	m_otiExistBottom = (COptionTreeItemCheckBox*)m_otTree.InsertItem(new COptionTreeItemCheckBox(), otiRoot);
	resStr.LoadString(IDS_REP_PR_DL_BOTTOM);
	m_otiExistBottom->SetLabelText(resStr);
	resStr.LoadString(IDS_REP_PR_DL_FULL_BOTTOM);
	m_otiExistBottom->SetInfoText(resStr);
	if (m_otiExistBottom->CreateCheckBoxItem(m_borderStyle&DIAGRAM_FRAME_STYLE_BOTTOM, OT_CHECKBOX_SHOWCHECK) == TRUE)
	{
		m_otiExistBottom->SetCheckText(yesS, noS);
	}
	m_otiFrameColorCombo = (COptionTreeItemColorComboBox*)m_otTree.InsertItem(new COptionTreeItemColorComboBox(), otiRoot);
	resStr.LoadString(IDS_PER_PR_DL_COL_FR);
	m_otiFrameColorCombo->SetLabelText(resStr);
	resStr.LoadString(IDS_PER_PR_DL_FULL_COL_FR);
	m_otiFrameColorCombo->SetInfoText(resStr);
	if (m_otiFrameColorCombo->CreateComboItem(NULL) == TRUE)
	{
		m_otiFrameColorCombo->SetCurColor(m_borderColor);	
	}
	m_otiFrameThicknessCombo = (COptionTreeItemLineThikComboBox*)m_otTree.InsertItem(new COptionTreeItemLineThikComboBox(), otiRoot);
	resStr.LoadString(IDS_PER_PR_DL_TH_FR);
	m_otiFrameThicknessCombo->SetLabelText(resStr);
	resStr.LoadString(IDS_PER_PR_DL_FULL_TH_FR);
	m_otiFrameThicknessCombo->SetInfoText(resStr);
	if (m_otiFrameThicknessCombo->CreateComboItem(NULL) == TRUE)
	{
		m_otiFrameThicknessCombo->SetLineThickness(m_borderThickness);
	}

	otiRoot->Expand();

	return TRUE;

}