I hacked shack's tabs dialog to be up to date with CVS. I've attached a
diff. When I use this dialog, it doesn't really do anything. I'm assuming
this is just a start with the UI. I would like to work on it, but I am
quite confused about what the dialog should do and how it should work. It
manages tabs, I suppose, but I have never used such a dialog or found a
need for one. Is the way the interface should be defined already designed
or can I take a stab at cleaning it up? I would appreciate some pointers
from someone who "gets" this dialog. It sounds like a fun project to me.
Aaron Lehmann
Index: src/text/fmt/xp/fb_Alignment.cpp
===================================================================
RCS file: /cvsroot/abi/src/text/fmt/xp/fb_Alignment.cpp,v
retrieving revision 1.5
diff -u -r1.5 fb_Alignment.cpp
--- src/text/fmt/xp/fb_Alignment.cpp 2000/05/16 16:22:43 1.5
+++ src/text/fmt/xp/fb_Alignment.cpp 2000/06/16 08:33:17
@@ -30,7 +30,7 @@
// Alignment left
/////////////////////////////////////////////////////////////
-void fb_Alignment_left::initialize(fp_Line *pLine)
+void fb_Alignment_left::initialize(fp_Line * /*pLine*/ )
{
}
Index: src/text/fmt/xp/fb_LineBreaker.cpp
===================================================================
RCS file: /cvsroot/abi/src/text/fmt/xp/fb_LineBreaker.cpp,v
retrieving revision 1.37
diff -u -r1.37 fb_LineBreaker.cpp
--- src/text/fmt/xp/fb_LineBreaker.cpp 2000/05/10 08:15:22 1.37
+++ src/text/fmt/xp/fb_LineBreaker.cpp 2000/06/16 08:33:17
@@ -139,21 +139,22 @@
if it's a left tab, then add its width to
the m_iWorkingLineWidth
*/
- UT_sint32 iPos;
- unsigned char iType;
+ UT_sint32 iPos;
+ eTabType iType;
+ eTabLeader iLeader;
// Subtract the width already added then work
out new
// tab position.
m_iWorkingLineWidth -=
pCurrentRun->getWidthInLayoutUnits();
- UT_Bool bRes =
pLine->findNextTabStopInLayoutUnits(m_iWorkingLineWidth, iPos, iType);
+ UT_Bool bRes =
+pLine->findNextTabStop(m_iWorkingLineWidth, iPos, iType, iLeader);
if (bRes)
{
-
- UT_DEBUGMSG(("%s(%d) tab run: type=%d
height=%d width=%d offset=%d length=%d\n",
+ UT_DEBUGMSG(("%s:%d tab run: p=%p
+type=%d leader=%d height=%d width=%d offset=%d length=%d\n",
__FILE__, __LINE__,
- iType,
+ (int)iType,
+ (int)iLeader,
pCurrentRun->getHeight(),
pCurrentRun->getWidth(),
pCurrentRun->getBlockOffset(),
Index: src/text/fmt/xp/fl_BlockLayout.cpp
===================================================================
RCS file: /cvsroot/abi/src/text/fmt/xp/fl_BlockLayout.cpp,v
retrieving revision 1.159
diff -u -r1.159 fl_BlockLayout.cpp
--- src/text/fmt/xp/fl_BlockLayout.cpp 2000/06/15 07:07:15 1.159
+++ src/text/fmt/xp/fl_BlockLayout.cpp 2000/06/16 08:33:19
@@ -118,7 +118,8 @@
{
iPosition = 0;
iPositionLayoutUnits = 0;
- iType = 0;
+ iType = FL_TAB_NONE;
+ iLeader = FL_LEADER_NONE;
}
static int compare_tabs(const void* p1, const void* p2)
@@ -254,8 +255,9 @@
const char* pszTabStops = getProperty("tabstops");
if (pszTabStops && pszTabStops[0])
{
- unsigned char iType = 0;
- UT_sint32 iPosition = 0;
+ eTabType iType = FL_TAB_NONE;
+ eTabLeader iLeader = FL_LEADER_NONE;
+ UT_sint32 iPosition = 0;
const char* pStart = pszTabStops;
while (*pStart)
@@ -298,8 +300,13 @@
case 'L': // fall through
default:
iType = FL_TAB_LEFT;
+ UT_DEBUGMSG(("tabstop: unknown tab stop type
+[%c]\n", p1[1]));
break;
}
+
+ // tab leaders
+ if ( p1 +2 != pEnd && p1[2] >= '0' && p1[2] <=
+(((UT_sint32)__FL_LEADER_MAX)+'0') )
+ iLeader = (eTabLeader)(p1[2]-'0');
}
char pszPosition[32];
@@ -323,6 +330,7 @@
pTabStop->iPosition = iPosition;
pTabStop->iPositionLayoutUnits =
UT_convertToLayoutUnits(pszPosition);
pTabStop->iType = iType;
+ pTabStop->iLeader = iLeader;
pTabStop->iOffset = pStart - pszTabStops;
m_vecTabs.addItem(pTabStop);
@@ -3327,12 +3335,16 @@
return bResult;
}
-UT_Bool fl_BlockLayout::findNextTabStop(UT_sint32 iStartX, UT_sint32 iMaxX,
UT_sint32& iPosition, unsigned char& iType)
+UT_Bool fl_BlockLayout::findNextTabStop( UT_sint32 iStartX, UT_sint32 iMaxX,
+UT_sint32& iPosition,
+
+eTabType & iType, eTabLeader &iLeader )
{
UT_ASSERT(iStartX >= 0);
UT_uint32 iCountTabs = m_vecTabs.getItemCount();
UT_uint32 i;
+
+ iLeader = FL_LEADER_NONE;
+
for (i=0; i<iCountTabs; i++)
{
fl_TabStop* pTab = (fl_TabStop*) m_vecTabs.getNthItem(i);
@@ -3397,12 +3409,16 @@
}
-UT_Bool fl_BlockLayout::findNextTabStopInLayoutUnits(UT_sint32 iStartX,
UT_sint32 iMaxX, UT_sint32& iPosition, unsigned char& iType)
+UT_Bool fl_BlockLayout::findNextTabStopInLayoutUnits( UT_sint32 iStartX,
+UT_sint32 iMaxX, UT_sint32& iPosition,
+
+ eTabType& iType, eTabLeader &iLeader)
{
UT_ASSERT(iStartX >= 0);
UT_uint32 iCountTabs = m_vecTabs.getItemCount();
UT_uint32 i;
+
+ UT_UNUSED(iLeader); // TODO FIXME
+
for (i=0; i<iCountTabs; i++)
{
fl_TabStop* pTab = (fl_TabStop*) m_vecTabs.getNthItem(i);
@@ -3466,7 +3482,8 @@
}
-UT_Bool fl_BlockLayout::s_EnumTabStops(void * myThis, UT_uint32 k, UT_sint32 &
iPosition, unsigned char & iType, UT_uint32 & iOffset)
+UT_Bool fl_BlockLayout::s_EnumTabStops( void * myThis, UT_uint32 k, UT_sint32 &
+iPosition,
+
+eTabType & iType, eTabLeader &iLeader, UT_uint32 & iOffset )
{
// a static function
@@ -3480,6 +3497,7 @@
iPosition = pTab->iPosition;
iType = pTab->iType;
+ iLeader = pTab->iLeader;
iOffset = pTab->iOffset;
return UT_TRUE;
}
@@ -3678,9 +3696,6 @@
void fl_BlockLayout::recheckIgnoredWords()
{
- fp_Run *pRun = m_pFirstRun;
- UT_ASSERT(pRun);
-
fl_PartOfBlock* pPOB;
// for scanning a word
Index: src/text/fmt/xp/fl_BlockLayout.h
===================================================================
RCS file: /cvsroot/abi/src/text/fmt/xp/fl_BlockLayout.h,v
retrieving revision 1.77
diff -u -r1.77 fl_BlockLayout.h
--- src/text/fmt/xp/fl_BlockLayout.h 2000/06/15 07:33:13 1.77
+++ src/text/fmt/xp/fl_BlockLayout.h 2000/06/16 08:33:19
@@ -56,6 +56,28 @@
class PX_ChangeRecord_StruxChange;
class fl_PartOfBlock;
+// Tab types and leaders
+typedef enum {
+ FL_TAB_NONE = 0,
+ FL_TAB_LEFT,
+ FL_TAB_CENTER,
+ FL_TAB_RIGHT,
+ FL_TAB_DECIMAL,
+ FL_TAB_BAR,
+ __FL_TAB_MAX
+} eTabType;
+
+typedef enum {
+ FL_LEADER_NONE = 0,
+ FL_LEADER_DOT,
+ FL_LEADER_HYPHEN,
+ FL_LEADER_UNDERLINE,
+ FL_LEADER_THICKLINE,
+ FL_LEADER_EQUALSIGN,
+ __FL_LEADER_MAX
+} eTabLeader;
+
+
class fl_CharWidths
{
public:
@@ -203,8 +225,10 @@
void checkForEndOnForcedBreak(void);
void checkSpelling(void);
- UT_Bool findNextTabStop(UT_sint32 iStartX, UT_sint32 iMaxX, UT_sint32&
iPosition, unsigned char& iType);
- UT_Bool findNextTabStopInLayoutUnits(UT_sint32 iStartX, UT_sint32 iMaxX,
UT_sint32& iPosition, unsigned char& iType);
+ UT_Bool findNextTabStop(UT_sint32 iStartX, UT_sint32 iMaxX, UT_sint32&
+iPosition,
+ eTabType& iType, eTabLeader
+&iLeader );
+ UT_Bool findNextTabStopInLayoutUnits(UT_sint32 iStartX, UT_sint32 iMaxX,
+UT_sint32& iPosition,
+
+eTabType& iType, eTabLeader &iLeader);
inline UT_sint32 getDefaultTabInterval(void) const { return
m_iDefaultTabInterval; }
inline UT_sint32 getTabsCount(void) const { return (UT_sint32)
m_vecTabs.getItemCount(); }
@@ -256,7 +280,8 @@
fl_PartOfBlock* getSquiggle(UT_uint32 iOffset) const;
void recheckIgnoredWords();
- static UT_Bool s_EnumTabStops(void * myThis, UT_uint32 k,
UT_sint32 & iPosition, unsigned char & iType, UT_uint32 & iOffset);
+ static UT_Bool s_EnumTabStops(void * myThis, UT_uint32 k,
+UT_sint32 & iPosition,
+
+eTabType & iType, eTabLeader &iLeader, UT_uint32 & iOffset );
#ifdef FMT_TEST
void __dump(FILE * fp) const;
@@ -383,21 +408,14 @@
protected:
};
-// TODO make a typedef to type type rather than just using 'unsigned char'
-
-#define FL_TAB_LEFT 1
-#define FL_TAB_CENTER 2
-#define FL_TAB_RIGHT 3
-#define FL_TAB_DECIMAL 4
-#define FL_TAB_BAR 5
-
struct fl_TabStop
{
fl_TabStop();
UT_sint32 iPosition;
UT_sint32 iPositionLayoutUnits;
- unsigned char iType;
+ eTabType iType;
+ eTabLeader iLeader;
UT_uint32 iOffset;
};
Index: src/text/fmt/xp/fp_Line.cpp
===================================================================
RCS file: /cvsroot/abi/src/text/fmt/xp/fp_Line.cpp,v
retrieving revision 1.70
diff -u -r1.70 fp_Line.cpp
--- src/text/fmt/xp/fp_Line.cpp 2000/06/11 14:53:12 1.70
+++ src/text/fmt/xp/fp_Line.cpp 2000/06/16 08:33:19
@@ -576,9 +576,10 @@
if (pRun->getType() == FPRUN_TAB)
{
UT_sint32 iPos;
- unsigned char iTabType;
+ eTabType iTabType;
+ eTabLeader iTabLeader;
- UT_Bool bRes = findNextTabStop(iX - iStartX, iPos, iTabType);
+ UT_Bool bRes = findNextTabStop(iX - iStartX, iPos, iTabType,
+iTabLeader);
UT_ASSERT(bRes);
fp_TabRun* pTabRun = static_cast<fp_TabRun*>(pRun);
@@ -825,12 +826,13 @@
return bResult;
}
-UT_Bool fp_Line::findNextTabStop(UT_sint32 iStartX, UT_sint32& iPosition,
unsigned char& iType)
+UT_Bool fp_Line::findNextTabStop(UT_sint32 iStartX, UT_sint32& iPosition,
+eTabType & iType, eTabLeader & iLeader )
{
- UT_sint32 iTabStopPosition = 0;
- unsigned char iTabStopType;
+ UT_sint32 iTabStopPosition = 0;
+ eTabType iTabStopType = FL_TAB_NONE;
+ eTabLeader iTabStopLeader = FL_LEADER_NONE;
- UT_Bool bRes = m_pBlock->findNextTabStop(iStartX + getX(), getX() +
getMaxWidth(), iTabStopPosition, iTabStopType);
+ UT_Bool bRes = m_pBlock->findNextTabStop(iStartX + getX(), getX() +
+getMaxWidth(), iTabStopPosition, iTabStopType, iTabStopLeader);
UT_ASSERT(bRes);
iTabStopPosition -= getX();
@@ -839,6 +841,7 @@
{
iPosition = iTabStopPosition;
iType = iTabStopType;
+ iLeader = iTabStopLeader;
return UT_TRUE;
}
@@ -848,12 +851,15 @@
}
}
-UT_Bool fp_Line::findNextTabStopInLayoutUnits(UT_sint32 iStartX, UT_sint32&
iPosition, unsigned char& iType)
+UT_Bool fp_Line::findNextTabStopInLayoutUnits(UT_sint32 iStartX, UT_sint32&
+iPosition, eTabType& iType, eTabLeader& iLeader )
{
- UT_sint32 iTabStopPosition = 0;
- unsigned char iTabStopType;
-
- UT_Bool bRes = m_pBlock->findNextTabStopInLayoutUnits(iStartX +
getXInLayoutUnits(), getXInLayoutUnits() + getMaxWidthInLayoutUnits(),
iTabStopPosition, iTabStopType);
+ UT_sint32 iTabStopPosition = 0;
+ eTabType iTabStopType = FL_TAB_NONE;
+ eTabLeader iTabStopLeader = FL_LEADER_NONE;
+
+ UT_Bool bRes = m_pBlock->findNextTabStopInLayoutUnits( iStartX +
+getXInLayoutUnits(),
+
+ getXInLayoutUnits() + getMaxWidthInLayoutUnits(),
+
+ iTabStopPosition, iTabStopType, iTabStopLeader);
UT_ASSERT(bRes);
iTabStopPosition -= getXInLayoutUnits();
@@ -862,6 +868,7 @@
{
iPosition = iTabStopPosition;
iType = iTabStopType;
+ iLeader = iTabStopLeader;
return UT_TRUE;
}
@@ -971,7 +978,6 @@
return UT_TRUE;
}
}
-
return UT_FALSE;
}
@@ -1006,13 +1012,16 @@
if (pRun->getType() == FPRUN_TAB)
{
- UT_sint32 iPos;
- unsigned char iTabType;
+ UT_sint32 iPos;
+ eTabType iTabType;
+ eTabLeader iTabLeader;
- UT_Bool bRes = findNextTabStop(iX, iPos, iTabType);
+ UT_Bool bRes = findNextTabStop(iX, iPos, iTabType,
+iTabLeader);
UT_ASSERT(bRes);
UT_ASSERT(iTabType == FL_TAB_LEFT);
+ // TODO -- support all the tabs [EMAIL PROTECTED]
+
fp_TabRun* pTabRun = static_cast<fp_TabRun*>(pRun);
pTabRun->setWidth(iPos - iX);
@@ -1045,9 +1054,10 @@
if (pRun->getType() == FPRUN_TAB)
{
UT_sint32 iPos;
- unsigned char iTabType;
+ eTabType iTabType;
+ eTabLeader iTabLeader;
- UT_Bool bRes = findNextTabStopInLayoutUnits(iX, iPos,
iTabType);
+ UT_Bool bRes = findNextTabStopInLayoutUnits(iX, iPos,
+iTabType, iTabLeader);
UT_ASSERT(bRes);
UT_ASSERT(iTabType == FL_TAB_LEFT);
Index: src/text/fmt/xp/fp_Line.h
===================================================================
RCS file: /cvsroot/abi/src/text/fmt/xp/fp_Line.h,v
retrieving revision 1.33
diff -u -r1.33 fp_Line.h
--- src/text/fmt/xp/fp_Line.h 2000/01/30 04:45:32 1.33
+++ src/text/fmt/xp/fp_Line.h 2000/06/16 08:33:19
@@ -127,9 +127,9 @@
UT_Bool isLastCharacter(UT_UCSChar Character) const;
- UT_Bool findNextTabStop(UT_sint32 iStartX, UT_sint32& iPosition,
unsigned char& iType);
- UT_Bool findNextTabStopInLayoutUnits(UT_sint32 iStartX, UT_sint32&
iPosition, unsigned char& iType);
-
+ UT_Bool findNextTabStop(UT_sint32 iStartX, UT_sint32& iPosition,
+eTabType& iType, eTabLeader& iLeader );
+ UT_Bool findNextTabStopInLayoutUnits(UT_sint32 iStartX, UT_sint32&
+iPosition, eTabType& iType, eTabLeader& iLeader);
+
void setNeedsRedraw(void) { m_bNeedsRedraw = UT_TRUE;
m_pBlock->setNeedsRedraw();}
UT_Bool needsRedraw(void) { return m_bNeedsRedraw; }
void redrawUpdate(void);
Index: src/text/fmt/xp/fp_Run.h
===================================================================
RCS file: /cvsroot/abi/src/text/fmt/xp/fp_Run.h,v
retrieving revision 1.55
diff -u -r1.55 fp_Run.h
--- src/text/fmt/xp/fp_Run.h 2000/06/03 20:14:14 1.55
+++ src/text/fmt/xp/fp_Run.h 2000/06/16 08:33:20
@@ -159,7 +159,7 @@
virtual UT_Bool
findMaxLeftFitSplitPointInLayoutUnits(UT_sint32 iMaxLeftWidth, fp_RunSplitInfo& si,
UT_Bool bForce=UT_FALSE) = 0;
virtual UT_sint32 findTrailingSpaceDistance(void) const { return
0; }
virtual UT_sint32 findTrailingSpaceDistanceInLayoutUnits(void)
const { return 0; }
- virtual UT_Bool findFirstNonBlankSplitPoint(fp_RunSplitInfo&
si) { return UT_FALSE; }
+ virtual UT_Bool findFirstNonBlankSplitPoint(fp_RunSplitInfo&
+/*si*/) { return UT_FALSE; }
virtual void mapXYToPosition(UT_sint32 xPos, UT_sint32
yPos, PT_DocPosition& pos, UT_Bool& bBOL, UT_Bool& bEOL) = 0;
virtual void findPointCoords(UT_uint32 iOffset, UT_sint32&
x, UT_sint32& y, UT_sint32& height) = 0;
virtual void lookupProperties(void) = 0;
Index: src/wp/ap/Makefile
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/Makefile,v
retrieving revision 1.66
diff -u -r1.66 Makefile
--- src/wp/ap/Makefile 2000/06/09 21:07:09 1.66
+++ src/wp/ap/Makefile 2000/06/16 08:33:20
@@ -38,6 +38,7 @@
$(OBJDIR)/ap_$(ABI_FE)Dialog_Paragraph.$(OBJ_SUFFIX) \
$(OBJDIR)/ap_$(ABI_FE)Dialog_Replace.$(OBJ_SUFFIX) \
$(OBJDIR)/ap_$(ABI_FE)Dialog_Spell.$(OBJ_SUFFIX) \
+ $(OBJDIR)/ap_$(ABI_FE)Dialog_Tab.$(OBJ_SUFFIX) \
$(OBJDIR)/ap_$(ABI_FE)Frame.$(OBJ_SUFFIX) \
$(OBJDIR)/ap_$(ABI_FE)LeftRuler.$(OBJ_SUFFIX) \
$(OBJDIR)/ap_$(ABI_FE)Prefs.$(OBJ_SUFFIX) \
@@ -76,6 +77,7 @@
$(OBJDIR)/ap_Dialog_Paragraph.$(OBJ_SUFFIX) \
$(OBJDIR)/ap_Dialog_Replace.$(OBJ_SUFFIX) \
$(OBJDIR)/ap_Dialog_Spell.$(OBJ_SUFFIX) \
+ $(OBJDIR)/ap_Dialog_Tab.$(OBJ_SUFFIX) \
$(OBJDIR)/ap_EditMethods.$(OBJ_SUFFIX) \
$(OBJDIR)/ap_FrameData.$(OBJ_SUFFIX) \
$(OBJDIR)/ap_LeftRuler.$(OBJ_SUFFIX) \
Index: src/wp/ap/unix/Makefile
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/unix/Makefile,v
retrieving revision 1.40
diff -u -r1.40 Makefile
--- src/wp/ap/unix/Makefile 2000/06/06 06:10:03 1.40
+++ src/wp/ap/unix/Makefile 2000/06/16 08:33:20
@@ -39,6 +39,7 @@
ap_$(ABI_FE)Dialog_Paragraph.cpp \
ap_$(ABI_FE)Dialog_Replace.cpp \
ap_$(ABI_FE)Dialog_Spell.cpp \
+ ap_$(ABI_FE)Dialog_Tab.cpp \
ap_$(ABI_FE)Dialog_Stub.cpp \
ap_$(ABI_FE)Dialog_WordCount.cpp \
ap_$(ABI_FE)Frame.cpp \
Index: src/wp/ap/unix/ap_UnixDialog_All.h
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/unix/ap_UnixDialog_All.h,v
retrieving revision 1.36
diff -u -r1.36 ap_UnixDialog_All.h
--- src/wp/ap/unix/ap_UnixDialog_All.h 2000/06/09 21:07:10 1.36
+++ src/wp/ap/unix/ap_UnixDialog_All.h 2000/06/16 08:33:20
@@ -49,6 +49,7 @@
# include "ap_UnixDialog_Paragraph.h"
# include "ap_UnixDialog_Options.h"
# include "ap_UnixDialog_Spell.h"
+# include "ap_UnixDialog_Tab.h"
# include "ap_UnixDialog_Insert_DateTime.h"
# include "ap_UnixDialog_WordCount.h"
# include "ap_UnixDialog_Field.h"
@@ -91,9 +92,10 @@
DeclareDialog(AP_DIALOG_ID_GOTO,
AP_UnixGnomeDialog_Goto)
DeclareDialog(AP_DIALOG_ID_BREAK,
AP_UnixGnomeDialog_Break)
DeclareDialog(AP_DIALOG_ID_SPELL, AP_UnixDialog_Spell)
- DeclareDialog(AP_DIALOG_ID_PARAGRAPH, AP_UnixGnomeDialog_Paragraph)
+ DeclareDialog(AP_DIALOG_ID_TAB, AP_UnixDialog_Tab)
+ DeclareDialog(AP_DIALOG_ID_PARAGRAPH, AP_UnixGnomeDialog_Paragraph)
DeclareDialog(AP_DIALOG_ID_OPTIONS,
AP_UnixGnomeDialog_Options)
- DeclareDialog(AP_DIALOG_ID_INSERT_DATETIME, AP_UnixDialog_Insert_DateTime)
+ DeclareDialog(AP_DIALOG_ID_INSERT_DATETIME, AP_UnixDialog_Insert_DateTime)
DeclareDialog(AP_DIALOG_ID_WORDCOUNT, AP_UnixGnomeDialog_WordCount)
DeclareDialog(AP_DIALOG_ID_FIELD,
AP_UnixGnomeDialog_Field)
@@ -117,7 +119,8 @@
DeclareDialog(AP_DIALOG_ID_BREAK, AP_UnixDialog_Break)
DeclareDialog(AP_DIALOG_ID_SPELL, AP_UnixDialog_Spell)
DeclareDialog(AP_DIALOG_ID_PARAGRAPH, AP_UnixDialog_Paragraph)
- DeclareDialog(AP_DIALOG_ID_OPTIONS, AP_UnixDialog_Options)
+ DeclareDialog(AP_DIALOG_ID_OPTIONS, AP_UnixDialog_Options)
+
+ DeclareDialog(AP_DIALOG_ID_TAB, AP_UnixDialog_Tab)
DeclareDialog(AP_DIALOG_ID_INSERT_DATETIME, AP_UnixDialog_Insert_DateTime)
DeclareDialog(AP_DIALOG_ID_WORDCOUNT, AP_UnixDialog_WordCount)
DeclareDialog(AP_DIALOG_ID_FIELD, AP_UnixDialog_Field)
Index: src/wp/ap/unix/ap_UnixDialog_Tab.cpp
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/unix/ap_UnixDialog_Tab.cpp,v
retrieving revision 1.2
diff -u -r1.2 ap_UnixDialog_Tab.cpp
--- src/wp/ap/unix/ap_UnixDialog_Tab.cpp 2000/05/11 04:16:59 1.2
+++ src/wp/ap/unix/ap_UnixDialog_Tab.cpp 2000/06/16 08:33:21
@@ -19,6 +19,7 @@
#include "ut_types.h"
#include "ut_string.h"
+#include "ut_units.h"
#include "ut_assert.h"
#include "ut_debugmsg.h"
@@ -27,6 +28,7 @@
#include "ut_dialogHelper.h"
#include "gr_UnixGraphics.h"
+#include "fl_BlockLayout.h"
#include "xap_App.h"
#include "xap_UnixApp.h"
@@ -58,8 +60,8 @@
XAP_Dialog_Id id)
: AP_Dialog_Tab(pDlgFactory,id)
{
- m_current_alignment = align_LEFT;
- m_current_leader = leader_NONE;
+ m_current_alignment = FL_TAB_LEFT;
+ m_current_leader = FL_LEADER_NONE;
m_bInSetCall = UT_FALSE;
}
@@ -794,10 +796,10 @@
UT_ASSERT(dlg);
UT_ASSERT(widget && GTK_IS_LIST_ITEM(widget));
- tTabInfo *pTabInfo = (tTabInfo *)
gtk_object_get_user_data(GTK_OBJECT(widget));
+ fl_TabStop *pTabInfo = (fl_TabStop *)
+gtk_object_get_user_data(GTK_OBJECT(widget));
UT_ASSERT(pTabInfo);
- UT_DEBUGMSG(("AP_UnixDialog_Tab::s_list_select [%s]\n", pTabInfo->pszTab ));
+ //UT_DEBUGMSG(("AP_UnixDialog_Tab::s_list_select [%s]\n", pTabInfo->pszTab ));
// get the -1, 0.. (n-1) index
dlg->m_iGtkListIndex =
gtk_list_child_position(GTK_LIST(dlg->_lookupWidget(id_LIST_TAB)), widget);
@@ -834,7 +836,7 @@
if ( dlg->m_bInSetCall || gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(widget)) == FALSE )
return;
- dlg->m_current_alignment =
(tAlignment)((UT_uint32)gtk_object_get_user_data(GTK_OBJECT(widget)));
+ dlg->m_current_alignment =
+(eTabType)((UT_uint32)gtk_object_get_user_data(GTK_OBJECT(widget)));
UT_DEBUGMSG(("AP_UnixDialog_Tab::s_alignment_change [%c]\n",
AlignmentToChar(dlg->m_current_alignment)));
dlg->_event_somethingChanged();
@@ -849,7 +851,7 @@
if ( dlg->m_bInSetCall || gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(widget)) == FALSE )
return;
- dlg->m_current_leader =
(tLeader)((UT_uint32)gtk_object_get_user_data(GTK_OBJECT(widget)));
+ dlg->m_current_leader =
+(eTabLeader)((UT_uint32)gtk_object_get_user_data(GTK_OBJECT(widget)));
UT_DEBUGMSG(("AP_UnixDialog_Tab::s_leader_change\n"));
dlg->_event_somethingChanged();
@@ -868,7 +870,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-AP_UnixDialog_Tab::tAlignment AP_UnixDialog_Tab::_gatherAlignment()
+eTabType AP_UnixDialog_Tab::_gatherAlignment()
{
// for ( UT_uint32 i = (UT_uint32)id_ALIGN_LEFT;
// i <= (UT_uint32)id_ALIGN_BAR;
@@ -877,7 +879,7 @@
return m_current_alignment;
}
-void AP_UnixDialog_Tab::_setAlignment( AP_UnixDialog_Tab::tAlignment a )
+void AP_UnixDialog_Tab::_setAlignment( eTabType a )
{
// NOTE - tControl id_ALIGN_LEFT .. id_ALIGN_BAR must be in the same order
// as the tAlignment enums.
@@ -898,12 +900,12 @@
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-AP_UnixDialog_Tab::tLeader AP_UnixDialog_Tab::_gatherLeader()
+eTabLeader AP_UnixDialog_Tab::_gatherLeader()
{
- return leader_NONE;
+ return FL_LEADER_NONE;
}
-void AP_UnixDialog_Tab::_setLeader( AP_UnixDialog_Tab::tLeader a )
+void AP_UnixDialog_Tab::_setLeader( eTabLeader a )
{
// NOTE - tControl id_LEADER_NONE .. id_ALIGN_BAR must be in the same order
// as the tAlignment enums.
@@ -945,17 +947,23 @@
GList *gList = NULL;
GtkList *wList = GTK_LIST(_lookupWidget( id_LIST_TAB ));
UT_uint32 i;
- tTabInfo *pTabInfo;
+ fl_TabStop *pTabInfo;
// clear all the items from the list
gtk_list_clear_items( wList, 0, -1 );
for ( i = 0; i < v.getItemCount(); i++ )
{
- pTabInfo = (tTabInfo *)v.getNthItem(i);
+ pTabInfo = (fl_TabStop *)v.getNthItem(i);
// this will do for the time being, but if we want
- GtkWidget *li = gtk_list_item_new_with_label( pTabInfo->pszTab );
+ //GtkWidget *li = gtk_list_item_new_with_label( pTabInfo->pszTab );
+ UT_DEBUGMSG(("%s:%d need to fix\n", __FILE__,__LINE__));
+
+ GtkWidget *li = gtk_list_item_new_with_label(
+ UT_convertToDimensionString(
+pTabInfo->iPositionLayoutUnits,
+
+ pTabInfo->iPosition ));
+
gtk_object_set_user_data( GTK_OBJECT(li), (gpointer) pTabInfo );
// we want to DO stuff
Index: src/wp/ap/unix/ap_UnixDialog_Tab.h
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/unix/ap_UnixDialog_Tab.h,v
retrieving revision 1.1
diff -u -r1.1 ap_UnixDialog_Tab.h
--- src/wp/ap/unix/ap_UnixDialog_Tab.h 2000/01/12 16:33:25 1.1
+++ src/wp/ap/unix/ap_UnixDialog_Tab.h 2000/06/16 08:33:21
@@ -44,8 +44,8 @@
// we implement these so the XP dialog can set/grab our data
#define SET_GATHER(a,t) virtual t _gather##a(void); \
virtual void _set##a( t )
- SET_GATHER (Alignment, tAlignment);
- SET_GATHER (Leader, tLeader);
+ SET_GATHER (Alignment, eTabType);
+ SET_GATHER (Leader, eTabLeader);
SET_GATHER (DefaultTabStop, UT_sint32);
@@ -76,8 +76,8 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// unix specific
- tAlignment m_current_alignment;
- tLeader m_current_leader;
+ eTabType m_current_alignment;
+ eTabLeader m_current_leader;
UT_Bool m_bInSetCall; // a flag set to tell the change
routines to ignore this message
UT_sint32 m_iGtkListIndex; // the -1, 0.. (N-1) index for the N
tabs
Index: src/wp/ap/xp/Makefile
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/xp/Makefile,v
retrieving revision 1.52
diff -u -r1.52 Makefile
--- src/wp/ap/xp/Makefile 2000/04/26 14:10:41 1.52
+++ src/wp/ap/xp/Makefile 2000/06/16 08:33:21
@@ -34,6 +34,8 @@
ap_Dialog_Paragraph.cpp \
ap_Dialog_Replace.cpp \
ap_Dialog_Spell.cpp \
+ ap_Dialog_Tab.cpp \
+ ap_Dialog_WordCount.cpp \
ap_EditMethods.cpp \
ap_FrameData.cpp \
ap_LeftRuler.cpp \
Index: src/wp/ap/xp/ap_Dialog_Id.h
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/xp/ap_Dialog_Id.h,v
retrieving revision 1.18
diff -u -r1.18 ap_Dialog_Id.h
--- src/wp/ap/xp/ap_Dialog_Id.h 2000/04/26 14:10:41 1.18
+++ src/wp/ap/xp/ap_Dialog_Id.h 2000/06/16 08:33:21
@@ -37,6 +37,7 @@
AP_DIALOG_ID_SPELL, /* spell check */
AP_DIALOG_ID_PARAGRAPH, /* paragraph settings dialog
*/
AP_DIALOG_ID_OPTIONS, /* edit|options settings
dialog */
+ AP_DIALOG_ID_TAB, /* tabs */
AP_DIALOG_ID_INSERT_DATETIME, /* insert date and time dialog */
AP_DIALOG_ID_FIELD, /* insert field dialog
*/
AP_DIALOG_ID_WORDCOUNT, /* word count dialog */
Index: src/wp/ap/xp/ap_Dialog_Tab.cpp
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/xp/ap_Dialog_Tab.cpp,v
retrieving revision 1.2
diff -u -r1.2 ap_Dialog_Tab.cpp
--- src/wp/ap/xp/ap_Dialog_Tab.cpp 2000/05/11 04:07:45 1.2
+++ src/wp/ap/xp/ap_Dialog_Tab.cpp 2000/06/16 08:33:21
@@ -47,7 +47,7 @@
AP_Dialog_Tab::~AP_Dialog_Tab(void)
{
- UT_VECTOR_PURGEALL(tTabInfo *, m_tabInfo);
+ UT_VECTOR_PURGEALL(fl_TabStop *, m_tabInfo);
}
AP_Dialog_Tab::tAnswer AP_Dialog_Tab::getAnswer(void) const
@@ -74,51 +74,49 @@
rulerInfo.m_iDefaultTabInterval,
rulerInfo.m_pszTabStops
));
-
+
+ // save the tab string location
+ m_pszTabStops = rulerInfo.m_pszTabStops;
+
int iTab;
- tTabInfo *pTabInfo;
+ fl_TabStop *pTabInfo;
for ( iTab = 0; iTab < rulerInfo.m_iTabStops; iTab++ )
{
// create new tab info
- pTabInfo = new tTabInfo();
+ pTabInfo = new fl_TabStop();
UT_ASSERT(pTabInfo);
-#if 0
- // get tab information
- (*rulerInfo.m_pfnEnumTabStops)(
- rulerInfo.m_pVoidEnumTabStopsData,
// void* pData
- iTab,
// UT_uint32 k
- pTabInfo->iPosition,
// UT_sint32& iPosition
- pTabInfo->iType,
// unsigned char& iType
- pTabInfo->iOffset,
// UT_uint32& iOffset
- pTabInfo->iLeader );
-#else
-// TMN: Pathched to get it to compile. Either 'iLeader' has been added here,
-// and the corresponding header has not been updated, or the the header
-// have dropped this last parameter. Let's hope it's the last assumption.
- (*rulerInfo.m_pfnEnumTabStops)(
- rulerInfo.m_pVoidEnumTabStopsData,
- iTab,
- pTabInfo->iPosition,
- pTabInfo->iType,
- pTabInfo->iOffset);
-#endif
+ (*rulerInfo.m_pfnEnumTabStops)( rulerInfo.m_pVoidEnumTabStopsData,
+ iTab, pTabInfo->iPosition,
+pTabInfo->iType, pTabInfo->iLeader,
+ pTabInfo->iOffset );
+
+ // if we're NOT the last tab
+ //if ( iTab + 1 != rulerInfo.mTabStops )
+ //{
+//
+// }
+ // else
+ //{
+//
+ // }
+
+
// parse string stuff out
- int i = 0;
- while ( rulerInfo.m_pszTabStops[pTabInfo->iOffset + i] &&
- rulerInfo.m_pszTabStops[pTabInfo->iOffset + i] != '/' &&
// remove /...
- rulerInfo.m_pszTabStops[pTabInfo->iOffset + i] != ',' )
- i++;
+ //int i = 0;
+ //while ( rulerInfo.m_pszTabStops[pTabInfo->iOffset + i] &&
+ // rulerInfo.m_pszTabStops[pTabInfo->iOffset + i] != '/' &&
+ // remove /...
+ // rulerInfo.m_pszTabStops[pTabInfo->iOffset + i] != ',' )
+ // i++;
// allocate a copy of the buffer (NOTE - we don't use all the space)
- pTabInfo->pszTab = new char[i+1];
- memcpy( pTabInfo->pszTab, &rulerInfo.m_pszTabStops[pTabInfo->iOffset],
i );
- pTabInfo->pszTab[i] = '\0';
+ //pTabInfo->pszTab = new char[i+1];
+ //memcpy( pTabInfo->pszTab,
+&rulerInfo.m_pszTabStops[pTabInfo->iOffset], i );
+ //pTabInfo->pszTab[i] = '\0';
// debug msgs
- UT_DEBUGMSG(("position=%d str=%s\n", pTabInfo->iPosition,
pTabInfo->pszTab ));
+ //UT_DEBUGMSG(("position=%d str=%s\n", pTabInfo->iPosition,
+pTabInfo->pszTab ));
m_tabInfo.addItem(pTabInfo);
}
@@ -175,7 +173,7 @@
UT_DEBUGMSG(("AP_Dialog_Tab::_event_TabChange\n"));
}
-void AP_Dialog_Tab::_event_TabSelected( tTabInfo *pTabInfo )
+void AP_Dialog_Tab::_event_TabSelected( fl_TabStop *pTabInfo )
{
UT_DEBUGMSG(("AP_Dialog_Tab::_event_TabSelected\n"));
@@ -186,10 +184,12 @@
// common set of constants. ap_TopRuler.cpp defines all the constants
// again. Here, since enum is rel 0, i'm subtracting one and doing an
// ugly type cast
- _setAlignment( (tAlignment)(pTabInfo->iType - 1) );
+ _setAlignment( pTabInfo->iType );
// set the edit box's text
- _setTabEdit( pTabInfo->pszTab );
+ //_setTabEdit( pTabInfo->pszTab );
+
+ UT_DEBUGMSG(("%s:%d need to setTabEdit\n",__FILE__,__LINE__));
// something changed...
_event_somethingChanged();
@@ -210,29 +210,29 @@
UT_DEBUGMSG(("AP_Dialog_Tab::_event_ClearAll\n"));
}
-/*static*/ unsigned char AP_Dialog_Tab::AlignmentToChar( AP_Dialog_Tab::tAlignment a
)
+/*static*/ unsigned char AP_Dialog_Tab::AlignmentToChar( eTabType a )
{
char ch;
switch ( a )
{
- case AP_Dialog_Tab::align_LEFT:
+ case FL_TAB_LEFT:
ch = 'L';
break;
- case AP_Dialog_Tab::align_RIGHT:
+ case FL_TAB_RIGHT:
ch = 'R';
break;
- case AP_Dialog_Tab::align_CENTER:
+ case FL_TAB_CENTER:
ch = 'C';
break;
- case AP_Dialog_Tab::align_DECIMAL:
+ case FL_TAB_DECIMAL:
ch = 'D';
break;
- case AP_Dialog_Tab::align_BAR:
+ case FL_TAB_BAR:
// fall through
default:
@@ -244,35 +244,34 @@
return ch;
}
-/*static*/ AP_Dialog_Tab::tAlignment AP_Dialog_Tab::CharToAlignment( unsigned char ch
)
+/*static*/ eTabType AP_Dialog_Tab::CharToAlignment( unsigned char ch )
{
- tAlignment a;
+ eTabType a;
switch ( ch )
{
case 'L':
- a = align_LEFT;
+ a = FL_TAB_LEFT;
break;
case 'R':
- a = align_RIGHT;
+ a = FL_TAB_RIGHT;
break;
case 'C':
- a = align_CENTER;
+ a = FL_TAB_CENTER;
break;
case 'D':
- a = align_DECIMAL;
+ a = FL_TAB_DECIMAL;
break;
case 'B': // not implemented, fall
though
- // a = align_BAR;
- // break;
+ //a = FL_TAB_BAR;
+ //break;
default:
UT_ASSERT(UT_NOT_IMPLEMENTED);
- a = align_LEFT;
-
+ a = FL_TAB_LEFT;
}
return a;
}
@@ -281,11 +280,11 @@
{
_clearList();
- UT_VECTOR_PURGEALL(tTabInfo *, m_tabInfo);
+ UT_VECTOR_PURGEALL(fl_TabStop *, m_tabInfo);
}
-void AP_Dialog_Tab::buildTab( char *buffer, int bufflen )
+void AP_Dialog_Tab::buildTab( char *buffer, UT_uint32 /*bufflen*/ )
{
// TODO - use snprintf
sprintf( buffer, "%s/%c", _gatherTabEdit(),
AlignmentToChar(_gatherAlignment()));
@@ -306,9 +305,10 @@
for ( UT_uint32 i = 0; i < m_tabInfo.getItemCount(); i++ )
{
- tTabInfo *pTabInfo = (tTabInfo *)m_tabInfo.getNthItem(i);
+ fl_TabStop *pTabInfo = (fl_TabStop *)m_tabInfo.getNthItem(i);
UT_ASSERT(pTabInfo);
+#if 0
// if we have a tab at that unit
if ( !strcmp(buffer, pTabInfo->pszTab) )
{
@@ -320,6 +320,7 @@
bEnableSet = UT_FALSE;
}
+#endif
}
_controlEnable( id_BUTTON_SET, bEnableSet );
Index: src/wp/ap/xp/ap_Dialog_Tab.h
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/xp/ap_Dialog_Tab.h,v
retrieving revision 1.1
diff -u -r1.1 ap_Dialog_Tab.h
--- src/wp/ap/xp/ap_Dialog_Tab.h 2000/01/12 16:33:25 1.1
+++ src/wp/ap/xp/ap_Dialog_Tab.h 2000/06/16 08:33:21
@@ -24,6 +24,7 @@
#include "xap_Dialog.h"
#include "xav_View.h"
#include "ut_units.h"
+#include "fl_BlockLayout.h"
class XAP_Frame;
@@ -43,8 +44,10 @@
typedef enum { id_EDIT_TAB = 0, id_LIST_TAB,
id_SPIN_DEFAULT_TAB_STOP,
+ // should be in same order as eTabType
+(fl_BlockLayout.h)
id_ALIGN_LEFT, id_ALIGN_CENTER, id_ALIGN_RIGHT,
id_ALIGN_DECIMAL, id_ALIGN_BAR,
+ // should be in same order as eTabLeader
+(fl_BlockLayout.h)
id_LEADER_NONE, id_LEADER_DOT, id_LEADER_DASH,
id_LEADER_UNDERLINE,
id_BUTTON_SET, id_BUTTON_CLEAR,
id_BUTTON_CLEAR_ALL,
@@ -52,22 +55,13 @@
id_last } tControl;
- typedef enum { align_LEFT = 0, align_CENTER, align_RIGHT,
- align_DECIMAL, align_BAR } tAlignment;
-
- typedef enum { leader_NONE = 0, leader_DOT, leader_DASH,
- leader_UNDERLINE } tLeader;
-
AP_Dialog_Tab::tAnswer getAnswer(void) const;
-
- static unsigned char AlignmentToChar( tAlignment );
- static tAlignment CharToAlignment( unsigned char );
-
-
// clear the tab list
void clearList();
+ static unsigned char AlignmentToChar( eTabType a );
+ static eTabType CharToAlignment( unsigned char ch );
protected:
@@ -85,16 +79,15 @@
void _storeWindowData(void);
// grab tab from the current text/align/leader controls
- void buildTab( char *buffer, int bufferlen );
+ void buildTab( char *buffer, UT_uint32 bufferlen );
// the actual access functions
#define SET_GATHER(a,u) virtual u _gather##a(void) = 0; \
virtual void _set##a( u ) = 0
- SET_GATHER (Alignment, tAlignment);
- SET_GATHER (Leader, tLeader);
- SET_GATHER (DefaultTabStop, UT_sint32);
+ SET_GATHER (Alignment, eTabType);
+ SET_GATHER (Leader, eTabLeader);
+ SET_GATHER (DefaultTabStop, UT_sint32); // at
+this point, in current default units
-
// to populate the whole list
SET_GATHER (TabList, const
UT_Vector &);
@@ -113,22 +106,15 @@
protected:
tAnswer m_answer;
XAP_Frame * m_pFrame;
-
- typedef struct {
- char * pszTab;
- UT_sint32 iPosition;
- unsigned char iType;
- XML_Char iLeader;
- UT_uint32 iOffset;
- } tTabInfo;
- UT_Vector m_tabInfo; // list of tTabInfo *
+ const char * m_pszTabStops; // from rulerInfo
+ UT_Vector m_tabInfo; // list of fl_TabStop *
- tTabInfo *m_CurrentTab; // the tab item selected
+ fl_TabStop *m_CurrentTab; // the tab item selected
// AP level handlers
void _event_TabChange(void); // when the edit box changes
- void _event_TabSelected( tTabInfo *tabSelect); // when a list item is
selected
+ void _event_TabSelected( fl_TabStop *tabSelect); // when a list item is
+selected
void _event_Set(void); // buttons
void _event_Clear(void);
Index: src/wp/ap/xp/ap_EditMethods.cpp
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/xp/ap_EditMethods.cpp,v
retrieving revision 1.208
diff -u -r1.208 ap_EditMethods.cpp
--- src/wp/ap/xp/ap_EditMethods.cpp 2000/06/11 14:20:08 1.208
+++ src/wp/ap/xp/ap_EditMethods.cpp 2000/06/16 08:33:23
@@ -48,6 +48,7 @@
#include "ap_Dialog_Paragraph.h"
#include "ap_Dialog_Options.h"
#include "ap_Dialog_Spell.h"
+#include "ap_Dialog_Tab.h"
#include "ap_Dialog_Insert_DateTime.h"
#include "ap_Dialog_Field.h"
#include "ap_Dialog_WordCount.h"
@@ -835,11 +836,11 @@
static UT_Bool s_AskCloseAllAndExit(XAP_Frame * pFrame)
{
// return UT_TRUE if we should quit.
-
return (pFrame->showMessageBox(AP_STRING_ID_MSG_QueryExit,
XAP_Dialog_MessageBox::b_YN,
XAP_Dialog_MessageBox::a_NO)
== XAP_Dialog_MessageBox::a_YES);
+
}
static XAP_Dialog_MessageBox::tAnswer s_AskSaveFile(XAP_Frame * pFrame)
@@ -2969,14 +2970,22 @@
= (AP_Dialog_Goto *)(pDialogFactory->requestDialog(id));
UT_ASSERT(pDialog);
- if(pDialog->isRunning() == UT_TRUE)
+ pDialog->runModeless(pFrame);
+
+ UT_Bool bOK = UT_TRUE;
+
+ // get result?
+
+ pDialogFactory->releaseDialog(pDialog);
+
+ if(pDialog->isRunning() == UT_TRUE)
{
- pDialog->activate();
- }
+ pDialog->activate();
+ }
else
- {
- pDialog->setView(pView);
- pDialog->runModeless(pFrame);
+ {
+ pDialog->setView(pView);
+ pDialog->runModeless(pFrame);
}
return UT_TRUE;
}
@@ -3359,6 +3368,44 @@
return UT_TRUE;
}
+static UT_Bool s_doTabDlg(FV_View * pView)
+{
+ XAP_Frame * pFrame = (XAP_Frame *) pView->getParentData();
+ UT_ASSERT(pFrame);
+
+ pFrame->raise();
+
+ XAP_DialogFactory * pDialogFactory
+ = (XAP_DialogFactory *)(pFrame->getDialogFactory());
+
+ AP_Dialog_Tab * pDialog
+ = (AP_Dialog_Tab *)(pDialogFactory->requestDialog(AP_DIALOG_ID_TAB));
+ UT_ASSERT(pDialog);
+
+ // run the dialog
+ pDialog->runModal(pFrame);
+
+ // get the dialog answer
+ AP_Dialog_Tab::tAnswer answer = pDialog->getAnswer();
+
+ switch (answer)
+ {
+ case AP_Dialog_Tab::a_OK:
+
+ break;
+
+ case AP_Dialog_Tab::a_CANCEL:
+ // do nothing
+ break;
+ default:
+ UT_ASSERT(UT_SHOULD_NOT_HAPPEN);
+ }
+
+ pDialogFactory->releaseDialog(pDialog);
+
+ return UT_TRUE;
+}
+
/*****************************************************************/
Defun1(dlgFont)
@@ -4078,11 +4125,9 @@
Defun1(dlgTabs)
{
- XAP_Frame * pFrame = (XAP_Frame *) pAV_View->getParentData();
- UT_ASSERT(pFrame);
-
- s_TellNotImplemented(pFrame, "Tabs dialog", __LINE__);
- return UT_TRUE;
+ ABIWORD_VIEW;
+
+ return s_doTabDlg(pView);
}
Defun0(noop)
Index: src/wp/ap/xp/ap_String_Id.h
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/xp/ap_String_Id.h,v
retrieving revision 1.40
diff -u -r1.40 ap_String_Id.h
--- src/wp/ap/xp/ap_String_Id.h 2000/06/14 12:14:43 1.40
+++ src/wp/ap/xp/ap_String_Id.h 2000/06/16 08:33:23
@@ -200,6 +200,28 @@
dcl(DLG_Options_Prompt_IgnoreResetCurrent, "Do you want to reset ignored words in
the current document?" )
dcl(DLG_Options_Prompt_IgnoreResetAll, "Do you want to reset ignored words in
all the documents?" )
+dcl(DLG_Tab_TabTitle, "Tabs")
+dcl(DLG_Tab_Label_TabPosition, "Tab stop position:")
+dcl(DLG_Tab_Label_TabToClear, "Tab stops to be cleared:")
+dcl(DLG_Tab_Label_DefaultTS, "Default tab stops:")
+
+dcl(DLG_Tab_Label_Alignment, "Alignment")
+dcl(DLG_Tab_Radio_Left, "Left")
+dcl(DLG_Tab_Radio_Center, "Center")
+dcl(DLG_Tab_Radio_Right, "Right")
+dcl(DLG_Tab_Radio_Decimal, "Decimal")
+dcl(DLG_Tab_Radio_Bar, "Bar")
+
+dcl(DLG_Tab_Label_Leader, "Leader")
+dcl(DLG_Tab_Radio_None, "&1 None")
+dcl(DLG_Tab_Radio_Dot, "&2 ..........")
+dcl(DLG_Tab_Radio_Dash, "&3 ----------")
+dcl(DLG_Tab_Radio_Underline, "&4 __________")
+
+dcl(DLG_Tab_Button_Set, "Set")
+dcl(DLG_Tab_Button_Clear, "Clear")
+dcl(DLG_Tab_Button_ClearAll, "Clear &All")
+
dcl(DLG_DateTime_DateTimeTitle, "Date and Time")
dcl(DLG_DateTime_AvailableFormats, "&Available formats:")
Index: src/wp/ap/xp/ap_TopRuler.cpp
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/xp/ap_TopRuler.cpp,v
retrieving revision 1.84
diff -u -r1.84 ap_TopRuler.cpp
--- src/wp/ap/xp/ap_TopRuler.cpp 2000/06/12 23:54:11 1.84
+++ src/wp/ap/xp/ap_TopRuler.cpp 2000/06/16 08:33:24
@@ -34,16 +34,6 @@
#include "ap_StatusBar.h"
#include "ap_Strings.h"
-// HACK: private copy of constants from fl_BlockLayout.h
-// TODO: find a better way of passing iType for tabs?
-// NOTE: this ordering is convenient for cycling m_iDefaultTabType
-
-#define FL_TAB_LEFT 1
-#define FL_TAB_CENTER 2
-#define FL_TAB_RIGHT 3
-#define FL_TAB_DECIMAL 4
-#define FL_TAB_BAR 5
-
#define tr_TABINDEX_NEW -1
#define tr_TABINDEX_NONE -2
@@ -587,12 +577,13 @@
void AP_TopRuler::_getTabStopXAnchor(AP_TopRulerInfo * pInfo,
UT_sint32 k,
UT_sint32 * pTab,
-
unsigned char & iType)
+
+eTabType & iType)
{
UT_sint32 xAbsLeft = _getFirstPixelInColumn(pInfo,pInfo->m_iCurrentColumn);
UT_sint32 iPosition;
UT_uint32 iOffset;
+ eTabLeader iLeader;
if (k == tr_TABINDEX_NEW)
{
@@ -606,7 +597,7 @@
UT_ASSERT(k<pInfo->m_iTabStops);
UT_Bool bRes =
pInfo->m_pfnEnumTabStops(pInfo->m_pVoidEnumTabStopsData,
-
k, iPosition, iType, iOffset);
+
+ k, iPosition, iType, iLeader, iOffset );
UT_ASSERT(bRes);
}
@@ -636,7 +627,7 @@
{
UT_sint32 anchor;
UT_Rect rect;
- unsigned char iType;
+ eTabType iType;
if (m_draggingWhat == DW_TABSTOP)
{
@@ -705,7 +696,7 @@
}
UT_sint32 AP_TopRuler::_findTabStop(AP_TopRulerInfo * pInfo,
- UT_uint32 x,
UT_uint32 y, unsigned char & iType)
+ UT_uint32 x,
+UT_uint32 y, eTabType & iType)
{
// hit-test all the existing tabs
// return the index of the one found
@@ -743,10 +734,11 @@
UT_sint32 iPosition;
UT_uint32 iOffset;
- unsigned char iType;
+ eTabType iType;
+ eTabLeader iLeader;
UT_Bool bRes = pInfo->m_pfnEnumTabStops(pInfo->m_pVoidEnumTabStopsData,
-
k, iPosition, iType, iOffset);
+
+ k, iPosition, iType, iLeader, iOffset );
UT_ASSERT(bRes);
const char* pStart = &pInfo->m_pszTabStops[iOffset];
@@ -1085,6 +1077,7 @@
case FL_TAB_CENTER: m_iDefaultTabType =
FL_TAB_RIGHT; break;
case FL_TAB_RIGHT: m_iDefaultTabType =
FL_TAB_DECIMAL; break;
case FL_TAB_DECIMAL: m_iDefaultTabType = FL_TAB_LEFT;
break;
+ default: UT_DEBUGMSG(("Should not happen, tab type
+%d\n", m_iDefaultTabType));
}
_drawTabToggle(NULL, UT_TRUE);
return;
@@ -1092,7 +1085,7 @@
// next hit-test against the tabs
- unsigned char iType;
+ eTabType iType;
UT_sint32 iTab = _findTabStop(&m_infoCache, x, y, iType);
if (iTab >= 0)
{
@@ -1410,7 +1403,7 @@
case DW_TABSTOP:
{
- unsigned char iType;
+ eTabType iType;
UT_sint32 iTab = _findTabStop(&m_infoCache, x, y, iType);
if (iTab >= 0)
@@ -2191,7 +2184,7 @@
}
}
-void AP_TopRuler::_drawTabStop(UT_Rect & rect, unsigned char iType, UT_Bool bFilled)
+void AP_TopRuler::_drawTabStop(UT_Rect & rect, eTabType iType, UT_Bool bFilled)
{
GR_Graphics::GR_Color3D clr3d;
if (bFilled)
Index: src/wp/ap/xp/ap_TopRuler.h
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/xp/ap_TopRuler.h,v
retrieving revision 1.42
diff -u -r1.42 ap_TopRuler.h
--- src/wp/ap/xp/ap_TopRuler.h 2000/04/20 00:52:30 1.42
+++ src/wp/ap/xp/ap_TopRuler.h 2000/06/16 08:33:24
@@ -30,6 +30,7 @@
#include "ap_Ruler.h"
#include "ev_EditBits.h"
#include "gr_Graphics.h"
+#include "fl_BlockLayout.h"
#include "xap_Strings.h"
class XAP_App;
@@ -60,7 +61,9 @@
// tab stop information
- UT_Bool (*m_pfnEnumTabStops)(void * pData,
UT_uint32 k, UT_sint32 & iPosition, unsigned char & iType, UT_uint32 & iOffset);
+ UT_Bool (*m_pfnEnumTabStops)(void * pData,
+UT_uint32 k,
+ UT_sint32 & iPosition,
+eTabType & iType, eTabLeader & iLeader,
+ UT_uint32 & iOffset );
void * m_pVoidEnumTabStopsData;
UT_sint32 m_iTabStops;
UT_sint32 m_iDefaultTabInterval;
@@ -155,13 +158,13 @@
void _getTabToggleRect(UT_Rect * prToggle);
void _drawTabToggle(const UT_Rect * pClipRect, UT_Bool bErase);
- void _getTabStopXAnchor(AP_TopRulerInfo * pInfo, UT_sint32 k, UT_sint32 *
pTab, unsigned char & iType);
+ void _getTabStopXAnchor(AP_TopRulerInfo * pInfo, UT_sint32 k, UT_sint32 *
+pTab, eTabType & iType);
void _getTabStopRect(AP_TopRulerInfo * pInfo, UT_sint32 anchor, UT_Rect *
pRect);
void _drawTabProperties(const UT_Rect * pClipRect,
AP_TopRulerInfo *
pInfo,
UT_Bool bDrawAll =
UT_TRUE);
- UT_sint32 _findTabStop(AP_TopRulerInfo * pInfo, UT_uint32 x,
UT_uint32 y, unsigned char & iType);
+ UT_sint32 _findTabStop(AP_TopRulerInfo * pInfo, UT_uint32 x,
+UT_uint32 y, eTabType & iType);
const char * _getTabStopString(AP_TopRulerInfo * pInfo, UT_sint32 k);
void _getTabZoneRect(AP_TopRulerInfo * pInfo, UT_Rect
&rZone);
void _setTabStops(ap_RulerTicks tick, UT_sint32 iTab,
UT_Bool bDelete);
@@ -186,7 +189,7 @@
void _drawLeftIndentMarker(UT_Rect & r, UT_Bool bFilled);
void _drawRightIndentMarker(UT_Rect & r, UT_Bool bFilled);
void _drawFirstLineIndentMarker(UT_Rect & r, UT_Bool bFilled);
- void _drawTabStop(UT_Rect & r, unsigned char iType, UT_Bool
bFilled);
+ void _drawTabStop(UT_Rect & r, eTabType iType, UT_Bool bFilled);
void _drawColumnGapMarker(UT_Rect & r);
UT_Bool _isInBottomBoxOfLeftIndent(UT_uint32 y);
void _displayStatusMessage(XAP_String_Id messageID, const
ap_RulerTicks &tick, double dValue);
@@ -230,11 +233,11 @@
UT_sint32 m_dragging2Center; /* center of drag-along */
UT_Rect m_dragging2Rect; /* rect of drag-along */
UT_sint32 m_draggingTab; /* index of tab being dragged
*/
- unsigned char m_draggingTabType;
+ eTabType m_draggingTabType;
UT_sint32 m_dragStart;
UT_Bool m_bBeforeFirstMotion;
- unsigned char m_iDefaultTabType;
+ eTabType m_iDefaultTabType;
UT_Bool m_bGuide; /* UT_TRUE ==> guide line
XORed onscreen */
UT_sint32 m_xGuide; /* valid iff m_bGuide */