#include <textinfo.h>
Inheritance diagram for TextInfoBarOp:

Public Member Functions | |
| TextInfoBarOp () | |
| Initialises the infobar. | |
| ~TextInfoBarOp () | |
| destructor - deletes the font cache | |
| MsgResult | Message (Msg *Msg) |
| Text info bar dialog message handler. | |
| void | InitControls () |
| Initialise the info bar. | |
| BOOL | StringToDouble (StringBase *pstrIn, double *pnOut, BOOL *IsMultiple) |
| Parses the text within the zoom factor combo-box, checking for a percentage factor ("%") or a multiplier factor ("x"), converting it to a number. | |
| BOOL | UpdateFieldsAfterTyping () |
| Called on idle events after typing. As simple typing does not send a SelChanged message (in a vain attempt to make typing faster) this function is called on idles in order to update the parts on the infobar that may have been affected by the typing. | |
Static Public Member Functions | |
| static BOOL | Init () |
| Initialises the TextInfoBarOp's static data. | |
| static void | DeInit () |
| DeInits the TextInfoBarOp's static data. | |
| static BOOL | Update (BOOL DoUpdate=FALSE) |
| Update the infobar according to the current selection called on selchange messages only update fields as required return if tool is not active. | |
| static BOOL | UpdateRulerBar (SelRange *pSelection, BOOL DoUpdate=FALSE) |
| Update the text ruler information shown in the ruler bar according to the current selection called on selchange messages only update the ruler bar if something has changed. | |
| static void | OnFieldChange (FontAttribute ThisChange) |
| Called whenever the user changes a field on the infobar Applies atrributes to the current selection. | |
| static void | AddFontToCombo (String_64 *FontName) |
| Called to add a font name to the end of the font combo box. | |
| static void | DoKernBumps (UINT32 ButtonID) |
| Called to "bump" kerning values. | |
| static void | DoTrackingBumps (UINT32 ButtonID) |
| Called to "bump" tracking values. | |
| static void | DoLineSpacingBumps (UINT32 ButtonID) |
| Called to "bump" Line Space values. | |
| static void | DoFontChange () |
| Called by Mainframe when a sys FontChange message is received Validates the font cache and updates the font menu. | |
| static BOOL | SetCurrentPointSize (MILLIPOINT PointSize) |
| Called to set the current PointSize. | |
| static BOOL | SetCurrentAspectRatio (FIXED16 Ratio) |
| Called to set the current AspectRatio. | |
| static BOOL | SetCurrentTracking (INT32 Tracking) |
| Called to set the current Tracking. | |
| static BOOL | SetCurrentHorizontalKern (INT32 Kern) |
| Called to set the current HorizontalKern. | |
| static BOOL | SetCurrentBaseLineShift (INT32 Kern) |
| Called to set the current BaseLineShift. | |
| static BOOL | SetCurrentLineSpace (INT32 LineSpace) |
| static BOOL | SetCurrentLineSpacePercent (double Percent) |
| Called to set the current Line Spacing as a relative percent Set LineSpace zero to indicate which mode we are in(RELATIVE/Absolute). | |
| static BOOL | SetCurrentFontName (String_64 *Name, FontClass Type, BOOL Cache) |
| Called to set the current font name (and now Class as well). | |
| static void | SetCurrentFontBold (BOOL IsBold) |
| Called to set the current Bold State. | |
| static void | SetCurrentFontItalic (BOOL IsItalic) |
| Called to set the current Italic State. | |
| static void | SetCurrentAutoKerning (BOOL IsAutoKerning) |
| Called to set the current auto kerning State. | |
| static void | SetCurrentFontUnderLine (BOOL IsUnderLine) |
| Called to set the current UnderLine State. | |
| static void | SetCurrentJustify (UINT32 ButtonID) |
| Called to set the current justify state. | |
| static void | SetCurrentScript (ScriptModes Script) |
| Called to set the current font ( i.e.the one in the edit field of the combo ). | |
| static void | EnableGadgets (BOOL Enable) |
| Called to GREY/ENABLE the gadgets on this bar. | |
| static BOOL | IsRulerOriginClaimed () |
| static INT32 | GetRulerOrigin () |
| static void | ReleaseRuler () |
| Release the ruler if it has been claimed and update it (called on tool deselection). | |
| static void | HighlightRulerSection (RulerBase *pRuler, UserRect &UpdateRect) |
| Show the position and width of the current text story on the ruler (called from TextTool when the ruler background is redrawn). | |
| static void | RenderRulerBlobs (RulerBase *pRuler, UserRect &UpdateRect) |
| Show the margin and tab stop blobs on the ruler (called from TextTool when the ruler foreground is redrawn). | |
| static BOOL | OnRulerClick (UserCoord PointerPos, ClickType Click, ClickModifiers Mods, Spread *pSpread, RulerBase *pRuler) |
| Called when the user has clicked on the ruler and we have claimed it. | |
| static BOOL | GetRulerStatusLineText (String_256 *pText, UserCoord PointerPos, Spread *pSpread, RulerBase *pRuler) |
| Allows us to set the status line text for the ruler. | |
| static void | ForceRulerRedraw () |
| Force a ruler redraw (called each time anything on the ruler has changed). | |
| static void | TabStopDragStarting (TabStopDragType) |
| Called when a tab stop drag starts (allows TextInfoBarOp to hide the implicit tab stops to avoid confusion. Otherwise, if the last tab stop was dragged, implicit tab stops would appear after the previous tab stop. | |
| static void | TabStopDragFinished () |
| Called when a tab stop drag finished, allowing TextInfoBarOp to display implicit tab stops again. | |
| static void | DoAddTabStop (MILLIPOINT Position) |
| Create a tab stop of the currently selected type at the given position and apply the new text ruler. | |
| static void | DoAddTabStop (TxtTabStop NewTabStop) |
| Add a tab stop to the currently displayed ruler and apply it. | |
| static void | DoApplyShownRuler () |
| Apply the currently shown ruler (used to remove a tab stop that has been dragged off the ruler - the tab stop is removed from the shown ruler when the drag starts, so to permanently delete it all we need to do is apply the shown ruler). | |
| static void | DoChangeLeftMargin (MILLIPOINT Ordinate) |
| Apply the changed left margin. | |
| static void | DoChangeRightMargin (MILLIPOINT Ordinate, BOOL bReset) |
| Apply the changed right margin. | |
| static void | DoChangeFirstIndent (MILLIPOINT Ordinate) |
| Apply the changed first line indent. | |
| static BOOL | IsDisplayFontInstalled () |
| Determine whether our display fonts are installed. | |
| static INT32 | BuildFontList () |
| Build a simple list of fonts. This function uses the call back API facility EnumFontFamilies to build a list of TrueType fonts. | |
| static void | RegainCaretOnOpEnd () |
| Used to try to regain the caret after an operation has completed. Currently only used from OpCut. | |
Public Attributes | |
| TextTool * | pTextTool |
Static Public Attributes | |
| static InformationBarOp * | pTextInfoBar = NULL |
| static FontDropDown * | NameDropDown = NULL |
| static BOOL | DisplayFontIsInstalled = FALSE |
| static double | SuperScriptSize |
| static double | SuperScriptOffset |
| static double | SubScriptSize |
| static double | SubScriptOffset |
Static Private Member Functions | |
| static BOOL | FindBitmapSize (ResourceID ID, UINT32 *pWidth, UINT32 *pHeight) |
| Find the width and height of a resource bitmap. | |
| static void | UpdateButtonStates () |
| updates the info bar buttons and edit fields | |
| static void | UpdateJustifyButtons (BOOL Clear=FALSE) |
| updates the Justify Buttons | |
| static void | UpdateScriptButtons () |
| updates the Super/SubScript Buttons | |
| static void | UpdateGadgets () |
| Update all infobar fields according to the data in InfoData. | |
| static void | RedrawUnitGadgets () |
| Force a redraw of all gadgets that work in units called on units changed message. | |
| static void | SetLineSpaceGadget () |
| Set up the line space edit field. | |
| static void | DoInputError (UINT32 GadgetID) |
| Text info bar dialog message handler. | |
| static INT32 | GetLogicalStoryWidth (TextStory *pStory) |
| Given a text story, find the width we want to display for it in the ruler bar. | |
Static Private Attributes | |
| static TextInfoBarData | InfoData |
| static TextRulerBarData | RulerData |
| static Document * | pDoc = NULL |
| static UnitType | CurrentFontUnits = COMP_POINTS |
| static BOOL | RegainCaretAfterOp = FALSE |
| static CommonAttrSet | CommonAttrsToFindSet |
| static UINT32 | CurrentTabButtonWidth |
| static UINT32 | TabBitmapWidth |
| static UINT32 | TabBitmapHeight |
| static UINT32 | LeftMarginBitmapWidth |
| static UINT32 | LeftMarginBitmapHeight |
| static UINT32 | RightMarginBitmapWidth |
Definition at line 262 of file textinfo.h.
|
|
Initialises the infobar.
Definition at line 382 of file textinfo.cpp. 00383 { 00384 DlgResID = _R(IDD_TEXT_INFO_BAR); 00385 00386 SuperScriptSize = Text_SuperScriptSize; 00387 SuperScriptOffset = Text_SuperScriptOffset; 00388 SubScriptSize = Text_SubScriptSize; 00389 SubScriptOffset = Text_SubScriptOffset; 00390 /*if (Camelot.DeclareSection("ScriptValues", 6)) 00391 { 00392 Camelot.DeclarePref(NULL, "SuperScriptSize", &SuperScriptSize); 00393 Camelot.DeclarePref(NULL, "SuperScriptOffset", &SuperScriptOffset); 00394 Camelot.DeclarePref(NULL, "SubScriptSize", &SubScriptSize); 00395 Camelot.DeclarePref(NULL, "SubScriptOffset", &SubScriptOffset,-100,100); 00396 } 00397 */ 00398 pTextTool = NULL; 00399 // InitFontCache(); 00400 pDoc = Document::GetSelected(); 00401 if(pDoc) 00402 CurrentFontUnits = pDoc->GetDocFontUnits(); 00403 00404 // NameDropDown = NULL; 00405 }
|
|
|
destructor - deletes the font cache
Definition at line 355 of file textinfo.cpp. 00356 { 00357 // DeleteFontCache(); 00358 pTextInfoBar= NULL; 00359 00360 // Delete our drop-down font list 00361 if (NameDropDown != NULL) 00362 { 00363 delete NameDropDown; 00364 NameDropDown = NULL; 00365 } 00366 }
|
|
|
Called to add a font name to the end of the font combo box.
Definition at line 2892 of file textinfo.cpp. 02893 { 02894 // if(pTextInfoBar) 02895 // pTextInfoBar->SetStringGadgetValue(_R(IDC_FONT_COMBO),FontName,TRUE,0); 02896 }
|
|
|
Build a simple list of fonts. This function uses the call back API facility EnumFontFamilies to build a list of TrueType fonts.
Definition at line 326 of file textinfo.cpp. 00327 { 00328 TextInfoBarEnumFont EnumObj; 00329 EnumObj.Execute(); 00330 00331 return EnumObj.GetCount(); 00332 }
|
|
|
DeInits the TextInfoBarOp's static data.
Definition at line 493 of file textinfo.cpp. 00494 { 00495 CommonAttrsToFindSet.DeleteAll(); 00496 }
|
|
|
Add a tab stop to the currently displayed ruler and apply it.
Definition at line 3475 of file textinfo.cpp. 03476 { 03477 // we create a new ruler attribute 03478 RulerData.pNewRuler = new AttrTxtRuler; 03479 if (RulerData.pNewRuler == NULL) return; 03480 03481 // copy the ruler contents from the currently shown ruler 03482 *RulerData.pNewRuler->Value.Value = *RulerData.pShownRuler; 03483 RulerData.pNewRuler->Value.AddTabStop(NewTabStop); 03484 // OnFieldChange will use pNewRuler 03485 OnFieldChange(RulerA); 03486 // just to avoid confusion - OnFieldChange has taken control of the object, so 03487 // let us forget about it 03488 RulerData.pNewRuler = NULL; 03489 }
|
|
|
Create a tab stop of the currently selected type at the given position and apply the new text ruler.
Definition at line 3448 of file textinfo.cpp. 03449 { 03450 // we create a new ruler attribute 03451 RulerData.pNewRuler = new AttrTxtRuler; 03452 if (RulerData.pNewRuler == NULL) return; 03453 03454 // copy the ruler contents from the currently shown ruler 03455 *RulerData.pNewRuler->Value.Value = *RulerData.pShownRuler; 03456 RulerData.pNewRuler->Value.AddTabStop(RulerData.CurrentTabType, Position); 03457 // OnFieldChange will use pNewRuler 03458 OnFieldChange(RulerA); 03459 // just to avoid confusion - OnFieldChange has taken control of the object, so 03460 // let us forget about it 03461 RulerData.pNewRuler = NULL; 03462 }
|
|
|
Apply the currently shown ruler (used to remove a tab stop that has been dragged off the ruler - the tab stop is removed from the shown ruler when the drag starts, so to permanently delete it all we need to do is apply the shown ruler).
Definition at line 3504 of file textinfo.cpp. 03505 { 03506 // we create a new ruler attribute 03507 RulerData.pNewRuler = new AttrTxtRuler; 03508 if (RulerData.pNewRuler == NULL) return; 03509 03510 // copy the ruler contents from the currently shown ruler 03511 *RulerData.pNewRuler->Value.Value = *RulerData.pShownRuler; 03512 // OnFieldChange will use pNewRuler 03513 OnFieldChange(RulerA); 03514 // just to avoid confusion - OnFieldChange has taken control of the object, so 03515 // let us forget about it 03516 RulerData.pNewRuler = NULL; 03517 // we just applied what we had in pShownRuler, so UpdateRuler() will think that 03518 // nothing has changed and not redraw the ruler - therefore, the caller will have 03519 // to call ForceRulerRedraw(), which is done in TabStopDragOp::DragFinished() below 03520 }
|
|
|
Apply the changed first line indent.
Definition at line 3556 of file textinfo.cpp. 03557 { 03558 // We allow the firstindent to become negative so hanging bullets are made easy (they would 03559 // otherwise require both the left margin and the first indent to be dragged) 03560 RulerData.IsFirstIndentValid = TRUE; 03561 RulerData.FirstIndent = Ordinate; 03562 OnFieldChange(FirstIndentA); 03563 ForceRulerRedraw(); 03564 }
|
|
|
Apply the changed left margin.
Definition at line 3533 of file textinfo.cpp. 03534 { 03535 // Technically, we could allow the left margin to become negative, i.e., to be located 03536 // to the left of the start of the text object, but this might confuse users, so prevent 03537 // it from happening. 03538 if (Ordinate < 0) Ordinate = 0; 03539 RulerData.IsLeftMarginValid = TRUE; 03540 RulerData.LeftMargin = Ordinate; 03541 OnFieldChange(LeftMarginA); 03542 ForceRulerRedraw(); 03543 }
|
|
||||||||||||
|
Apply the changed right margin.
Definition at line 3577 of file textinfo.cpp. 03578 { 03579 // the right margin is actually an indent, i.e., an offset from the column width (otherwise 03580 // we could not have a default attribute that makes sense and text objects with different 03581 // widths would have to have different right margin attributes) 03582 RulerData.IsRightMarginValid = TRUE; 03583 RulerData.RightMargin = bReset ? 0 : (RulerData.CurrentRulerSectionWidth - Ordinate); 03584 // Technically, we could allow the margin to become negative, i.e., to be located to the 03585 // right of the column width, but this might confuse users, so prevent it from happening 03586 if (RulerData.RightMargin < 0) RulerData.RightMargin = 0; 03587 OnFieldChange(RightMarginA); 03588 ForceRulerRedraw(); 03589 }
|
|
|
Called by Mainframe when a sys FontChange message is received Validates the font cache and updates the font menu.
Definition at line 2013 of file textinfo.cpp. 02014 { 02015 // force a reformat and redraw of all text stories on all documents 02016 02017 // Get a pointer to the StartDocument 02018 /* 02019 02020 Document* pDocument = (Document*) Camelot.Documents.GetHead(); 02021 DocRect InvalidRgn; 02022 DocRect NewRect; 02023 02024 while (pDocument != NULL) 02025 { 02026 02027 // Get a pointer to the StartDocument node 02028 Node* pStartNode = pDocument->GetFirstNode(); 02029 ERROR3IF(pStartNode == NULL, "(BaseDocument::PostImport) TreeStart was NULL"); 02030 BOOL ok = TRUE; 02031 02032 // Get a pointer to the NodeDocument node 02033 if (pStartNode != NULL) 02034 { 02035 pStartNode = pStartNode->FindNext(); 02036 ERROR3IF(pStartNode == NULL, "(BaseDocument::PostImport) No NodeDocument after StartDocument"); 02037 } 02038 02039 // Scan through the tree, formating and redrawing all text stories 02040 if (pStartNode != NULL) 02041 { 02042 Node* pCurrentNode = pStartNode->FindFirstDepthFirst(); 02043 02044 while (pCurrentNode != NULL) 02045 { 02046 if(IS_A(pCurrentNode,TextStory)) 02047 { 02048 TextStory* pTextStory=(TextStory*)pCurrentNode; 02049 02050 InvalidRgn = pTextStory->GetUnionBlobBoundingRect(); 02051 pTextStory->FlagAffectedByOp(); 02052 ok=pTextStory->FormatAndChildren(); 02053 02054 if (ok) 02055 { 02056 NewRect = pTextStory->GetUnionBlobBoundingRect(); 02057 InvalidRgn = InvalidRgn.Union(NewRect); 02058 } 02059 02060 if (ok) 02061 pDocument->ForceRedraw(pTextStory->FindParentSpread(), InvalidRgn, TRUE); 02062 02063 } 02064 pCurrentNode = pCurrentNode->FindNextDepthFirst(pStartNode); 02065 }// end depth first search loop 02066 } 02067 02068 pDocument->FlushRedraw(); 02069 pDocument = (Document*) Camelot.Documents.GetNext(pDocument); 02070 }// end reformat loop 02071 02072 */ 02073 02074 OpAffectFontChange* pFontChange = new OpAffectFontChange(); 02075 if (pFontChange!=NULL) 02076 pFontChange->DoAffectFontChange(); 02077 02078 // Update the text info bar font drop list (if it's there) 02079 if(NameDropDown != NULL) 02080 { 02081 NameDropDown->KillList(); 02082 NameDropDown->FillInFontList(); 02083 FontDropItem Dummy(InfoData.FontName, InfoData.FontType); 02084 NameDropDown->SetSelection(&Dummy); 02085 } 02086 02087 // Update the actual combobox if the texttool is active 02088 if(pTextInfoBar!= NULL &&pTextInfoBar->HasWindow()) 02089 { 02090 pTextInfoBar->SetComboListLength(_R(IDC_FONT_COMBO)); 02091 Update(); 02092 } 02093 }
|
|
|
Text info bar dialog message handler.
Definition at line 2204 of file textinfo.cpp. 02205 { 02206 String_256 sErrString; 02207 String_64 sWarnString(_R(IDS_INVALID_FONTSIZE)); 02208 String_8 sAndString(_R(IDS_AND)); 02209 String_16 sMaxStr(_T("0")); 02210 String_16 sMinStr(_T("0")); 02211 02212 if (GadgetID == _R(IDC_TRACKING_EDIT)) 02213 { 02214 sMinStr._MakeMsg(TEXT("#1%dems"),-TrackingLimit); 02215 sMaxStr._MakeMsg(TEXT("#1%dems"),TrackingLimit); 02216 } 02217 else if (GadgetID == _R(IDC_KERN_EDIT_X)) 02218 { 02219 sMinStr._MakeMsg(TEXT("#1%dems"),-KernLimit); 02220 sMaxStr._MakeMsg(TEXT("#1%dems"),KernLimit); 02221 } 02222 else if (GadgetID == _R(IDC_KERN_EDIT_Y)) 02223 { 02224 Convert::MillipointsToString(-BaseLineLimit, MILLIPOINTS, &sMinStr); 02225 Convert::MillipointsToString(BaseLineLimit, MILLIPOINTS, &sMaxStr); 02226 } 02227 else if (GadgetID == _R(IDC_SPACING_EDIT)) 02228 { 02229 Convert::MillipointsToString(-LineSpaceLimit, MILLIPOINTS, &sMinStr); 02230 Convert::MillipointsToString(LineSpaceLimit, MILLIPOINTS, &sMaxStr); 02231 } 02232 else if (GadgetID == _R(IDC_ASPECTEDIT)) 02233 { 02234 sMinStr._MakeMsg(TEXT("#1%d%"),FontAspectMin); 02235 sMaxStr._MakeMsg(TEXT("#1%d%"),FontAspectMax); 02236 } 02237 else if (GadgetID == _R(IDC_POINT_COMBO)) 02238 { 02239 Convert::MillipointsToString(FontSizeMax, CurrentFontUnits, &sMaxStr); 02240 Convert::MillipointsToString(FontSizeMin, CurrentFontUnits, &sMinStr); 02241 } 02242 else 02243 { 02244 return; 02245 } 02246 02247 sErrString._MakeMsg(_T("#1%s #2%s #3%s #4%s\n"), 02248 (TCHAR*)sWarnString, 02249 (TCHAR*)sMinStr, 02250 (TCHAR*)sAndString, 02251 (TCHAR*)sMaxStr); 02252 02253 Error::SetError(0,(TCHAR* )sErrString,0); 02254 InformError(); 02255 }
|
|
|
Called to "bump" kerning values.
Definition at line 1852 of file textinfo.cpp. 01853 { 01854 if (Button == _R(IDC_KERN_BUMP_X_LESS)) 01855 { 01856 if(InfoData.HorizontalKern>=-(KernLimit-KernNudge)) 01857 { 01858 SetCurrentHorizontalKern(InfoData.HorizontalKern-KernNudge); 01859 pTextInfoBar->SetLongGadgetValue(_R(IDC_KERN_EDIT_X),InfoData.HorizontalKern,0,-1); 01860 } 01861 } 01862 else if (Button == _R(IDC_KERN_BUMP_X_MORE)) 01863 { 01864 if(InfoData.HorizontalKern<=(KernLimit-KernNudge)) 01865 { 01866 SetCurrentHorizontalKern(InfoData.HorizontalKern+KernNudge); 01867 pTextInfoBar->SetLongGadgetValue(_R(IDC_KERN_EDIT_X),InfoData.HorizontalKern,0,-1); 01868 } 01869 } 01870 else if (Button == _R(IDC_KERN_BUMP_Y_LESS)) 01871 { 01872 if ((InfoData.BaseLineShift != INVALID_ATTVAL) && (InfoData.BaseLineShift>=-(BaseLineLimit-BaseLineNudge))) 01873 { 01874 SetCurrentBaseLineShift(InfoData.BaseLineShift-BaseLineNudge); 01875 pTextInfoBar->SetUnitGadgetValue(_R(IDC_KERN_EDIT_Y),CurrentFontUnits,InfoData.BaseLineShift,0,-1); 01876 } 01877 } 01878 else if (Button == _R(IDC_KERN_BUMP_Y_MORE)) 01879 { 01880 if ((InfoData.BaseLineShift != INVALID_ATTVAL) && (InfoData.BaseLineShift<=(BaseLineLimit-BaseLineNudge))) 01881 { 01882 SetCurrentBaseLineShift(InfoData.BaseLineShift+BaseLineNudge); 01883 pTextInfoBar->SetUnitGadgetValue(_R(IDC_KERN_EDIT_Y),CurrentFontUnits,InfoData.BaseLineShift,0,-1); 01884 } 01885 } 01886 }
|
|
|
Called to "bump" Line Space values.
Definition at line 1942 of file textinfo.cpp. 01943 { 01944 BOOL ChangedValue = FALSE; 01945 01946 if (Button == _R(IDC_SPACING_LESS)) 01947 { 01948 if(InfoData.IsLineSpaceAPercent == FALSE) 01949 { 01950 if(InfoData.LineSpace == INVALID_ATTVAL) 01951 return; 01952 if(InfoData.LineSpace>=-(LineSpaceLimit-LineSpaceNudge)) 01953 { 01954 SetCurrentLineSpace(InfoData.LineSpace-LineSpaceNudge); 01955 ChangedValue = TRUE; 01956 } 01957 } 01958 else 01959 { 01960 if(InfoData.LineSpacePercent == INVALID_ATTVAL) 01961 return; 01962 if(InfoData.LineSpacePercent>=(LineSpacePercentMin+LineSpacePercentNudge)) 01963 { 01964 SetCurrentLineSpacePercent(InfoData.LineSpacePercent - LineSpacePercentNudge); 01965 ChangedValue = TRUE; 01966 } 01967 } 01968 } 01969 else if (Button == _R(IDC_SPACING_MORE)) 01970 { 01971 if(InfoData.IsLineSpaceAPercent == FALSE) 01972 { 01973 if(InfoData.LineSpace == INVALID_ATTVAL) 01974 return; 01975 if(InfoData.LineSpace<=(LineSpaceLimit-LineSpaceNudge)) 01976 { 01977 SetCurrentLineSpace(InfoData.LineSpace+LineSpaceNudge); 01978 ChangedValue = TRUE; 01979 } 01980 } 01981 else 01982 { 01983 if(InfoData.LineSpacePercent == INVALID_ATTVAL) 01984 return; 01985 if(InfoData.LineSpacePercent<=(LineSpacePercentMax - LineSpacePercentNudge)) 01986 { 01987 SetCurrentLineSpacePercent(InfoData.LineSpacePercent + LineSpacePercentNudge); 01988 ChangedValue = TRUE; 01989 } 01990 } 01991 } 01992 01993 if(ChangedValue) 01994 SetLineSpaceGadget(); 01995 }
|
|
|
Called to "bump" tracking values.
Definition at line 1904 of file textinfo.cpp. 01905 { 01906 if (InfoData.Tracking == INVALID_ATTVAL) 01907 return; 01908 01909 if (Button == _R(IDC_TRACKING_LESS)) 01910 { 01911 if(InfoData.Tracking>=-(TrackingLimit-TrackingNudge)) 01912 { 01913 SetCurrentTracking(InfoData.Tracking-TrackingNudge); 01914 pTextInfoBar->SetLongGadgetValue(_R(IDC_TRACKING_EDIT),InfoData.Tracking,0,-1); 01915 } 01916 } 01917 else if (Button == _R(IDC_TRACKING_MORE)) 01918 { 01919 if(InfoData.Tracking<=(TrackingLimit-TrackingNudge)) 01920 { 01921 SetCurrentTracking(InfoData.Tracking+TrackingNudge); 01922 pTextInfoBar->SetLongGadgetValue(_R(IDC_TRACKING_EDIT),InfoData.Tracking,0,-1); 01923 } 01924 } 01925 }
|
|
|
Called to GREY/ENABLE the gadgets on this bar.
Definition at line 1546 of file textinfo.cpp. 01547 { 01548 if(pTextInfoBar== NULL) 01549 return; 01550 if(!pTextInfoBar->HasWindow()) 01551 return; 01552 pTextInfoBar->EnableGadget(_R(IDC_TRACKINGBIT) ,Enable); 01553 pTextInfoBar->EnableGadget(_R(IDC_KERNINGBIT) ,Enable); 01554 01555 // pTextInfoBar->EnableGadget(_R(IDC_TEXT),Enable); 01556 pTextInfoBar->EnableGadget(_R(IDC_FONT_COMBO),Enable); 01557 pTextInfoBar->EnableGadget(_R(IDC_POINT_COMBO),Enable); 01558 pTextInfoBar->EnableGadget(_R(IDC_BOLDBUTTON),Enable); 01559 pTextInfoBar->EnableGadget(_R(IDC_ITALICBUTTON),Enable); 01560 // pTextInfoBar->EnableGadget(_R(IDC_UNDERLINEBUTTON),Enable); 01561 pTextInfoBar->EnableGadget(_R(IDC_ASPECTBIT),Enable); 01562 pTextInfoBar->EnableGadget(_R(IDC_ASPECTEDIT),Enable); 01563 pTextInfoBar->EnableGadget(_R(IDC_JUSTIFYLEFT),Enable); 01564 pTextInfoBar->EnableGadget(_R(IDC_JUSTIFYCENTRE),Enable); 01565 pTextInfoBar->EnableGadget(_R(IDC_JUSTIFYRIGHT),Enable); 01566 pTextInfoBar->EnableGadget(_R(IDC_JUSTIFYFULL),Enable); 01567 pTextInfoBar->EnableGadget(_R(IDC_KERN_EDIT_X),Enable); 01568 pTextInfoBar->EnableGadget(_R(IDC_KERN_EDIT_Y),Enable); 01569 pTextInfoBar->EnableGadget(_R(IDC_KERN_BUMP_X_LESS),Enable); 01570 pTextInfoBar->EnableGadget(_R(IDC_KERN_BUMP_X_MORE),Enable); 01571 pTextInfoBar->EnableGadget(_R(IDC_KERN_BUMP_Y_LESS),Enable); 01572 pTextInfoBar->EnableGadget(_R(IDC_KERN_BUMP_Y_MORE),Enable); 01573 pTextInfoBar->EnableGadget(_R(IDC_TRACKING_EDIT),Enable); 01574 pTextInfoBar->EnableGadget(_R(IDC_TRACKING_LESS),Enable); 01575 pTextInfoBar->EnableGadget(_R(IDC_TRACKING_MORE),Enable); 01576 01577 pTextInfoBar->EnableGadget(_R(IDC_SPACING_EDIT),Enable); 01578 pTextInfoBar->EnableGadget(_R(IDC_SPACING_LESS),Enable); 01579 pTextInfoBar->EnableGadget(_R(IDC_SPACING_MORE),Enable); 01580 01581 pTextInfoBar->EnableGadget(_R(IDC_AUTOKERN),Enable); 01582 //pTextInfoBar->EnableGadget(_R(IDC_KERN_EDIT_Y2),Enable); 01583 01584 }
|
|
||||||||||||||||
|
Find the width and height of a resource bitmap.
Definition at line 464 of file textinfo.cpp. 00465 { 00466 BOOL ok = FALSE; 00467 OILBitmap* pOilBitmap = OILBitmap::Create(); 00468 if (pOilBitmap) ok = pOilBitmap->LoadBitmap(ID); 00469 if (ok) 00470 { 00471 // create a kernel bitmap based on our OilBitmap 00472 KernelBitmap KBitmap(pOilBitmap); 00473 if (KBitmap.IsOK()) 00474 { 00475 *pWidth = KBitmap.GetWidth(); 00476 *pHeight = KBitmap.GetHeight(); 00477 ok = TRUE; 00478 } 00479 } 00480 return ok; 00481 }
|
|
|
Force a ruler redraw (called each time anything on the ruler has changed).
Definition at line 2978 of file textinfo.cpp. 02979 { 02980 DocView* pDocView = DocView::GetSelected(); 02981 if (pDocView) 02982 { 02983 RulerPair* pRulerPair = pDocView->GetpRulerPair(); 02984 if (pRulerPair) pRulerPair->Update(); 02985 } 02986 }
|
|
|
Given a text story, find the width we want to display for it in the ruler bar.
Definition at line 3603 of file textinfo.cpp. 03604 { 03605 if (pStory->IsWordWrapping()) 03606 { 03607 // either the width the user set or, if on a path, the length of the path 03608 // minus the left and right indents (as set in TextStory::FormatAndChildren 03609 // when formatting the story) 03610 return pStory->GetStoryWidth(); 03611 } 03612 else 03613 { 03614 // text at point - infinite width 03615 return -1; 03616 } 03617 }
|
|
|
Definition at line 314 of file textinfo.h. 00314 { return RulerData.CurrentRulerOrigin; }
|
|
||||||||||||||||||||
|
Allows us to set the status line text for the ruler.
Definition at line 3202 of file textinfo.cpp. 03204 { 03205 if (!pRuler->IsHorizontal()) return FALSE; 03206 03207 // first of all, check whether we are over the current tab type button 03208 DocView* pDocView = pRuler->GetpRulerPair()->GetpDocView(); 03209 MILLIPOINT PixelSize = pDocView->GetScaledPixelWidth().MakeLong(); 03210 MILLIPOINT Distance1 = (( |