LRESULT CStrokeDlg::OnStrokeDashChanged(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) { double dashArray[6]; for (int n = 0; n < 6; n++) { BOOL bTrans; dashArray[n] = GetDlgItemValue(m_hWnd, IDC_STROKE_DASHED0+n, &bTrans); if (!bTrans) { dashArray[n] = -1; break; } } for (int i = 0; i < m_targetObjects.GetSize(); i++) { for (int j = 0; j < n; j++) { m_targetObjects[i]->setDashedValue(j, dashArray[j]); } } return 0; }
LRESULT CTabsDlg::OnChangedValueX(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) { long selected; m_tabsCtl->get_selected(&selected); if (selected != 0) { BOOL bTrans; float x = (float)GetDlgItemValue(m_hWnd, IDC_TABS_X, &bTrans); if (!bTrans) { MessageBox("Invalid X value", "PageDesigner", MB_OK); return 0; } if (selected < 0) { float marginLeft; m_textPara->GetLeftIndent(&marginLeft); float marginRight; m_textPara->GetRightIndent(&marginRight); float textIndent; m_textPara->GetFirstLineIndent(&textIndent); if (selected == -3) { marginRight = x; } else if (selected == -2) { textIndent = x; } else if (selected == -1) { marginLeft = x; } m_textPara->SetIndents(textIndent, marginLeft, marginRight); } else // Tab { float tbPos; m_textPara->GetTab(selected-1, &tbPos, NULL, NULL); float newtbPos = x; if (tbPos != newtbPos) { long newIndex; m_textPara->SetTabPos(selected-1, newtbPos, &newIndex); m_tabsCtl->put_selected(newIndex+1); } } } return 0; }
LRESULT CStrokeDlg::OnStrokeWeightChanged(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) { BOOL bTrans; double strokeWeight = GetDlgItemValue(m_hWnd, IDC_STROKE_WEIGHT, &bTrans); if (bTrans) { for (int i = 0; i < m_targetObjects.GetSize(); i++) { m_targetObjects[i]->put_strokeWeight(strokeWeight); } } return 0; }