home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 February
/
PCWK0297.iso
/
lotus
/
english
/
lotus039.dsk
/
GTSCRPT2.LSS
< prev
next >
Wrap
Text File
|
1995-10-11
|
26KB
|
762 lines
Use "lsconst"
Use "gtstring"
Use "gtconst"
'//-------------------------------------------------------------------------------------
'// Post Tips scripts - displayed at when a Content Topic is chosen
'//-------------------------------------------------------------------------------------
Public Sub ITStrategyMessage()
Dim OutMsg As String
OutMsg = ITStrategyMsg1 + Chr$(10) + Chr$(10) + ITStrategyMsg2
Messagebox OutMsg, 0, ITStrategyTitle
End Sub
Public Sub MarketStrategyMessage()
Dim OutMsg As String
OutMsg = MarketStrategyMsg + Chr$(10) + Chr$(10) + KotlerCommon1 + Chr$(10) + Chr$(10) + _
KotlerCommon2 + Chr$(10) + Chr$(10) + KotlerCommon3 + Chr$(10) + Chr$(10) + KotlerCommon4
Messagebox OutMsg, 0, MarketStrategyTitle
End Sub
Public Sub MarketSegmentationMessage()
Dim OutMsg As String
OutMsg = MarketSegmentationMsg + Chr$(10) + Chr$(10) + KotlerCommon1 + Chr$(10) + Chr$(10) + _
KotlerCommon2 + Chr$(10) + Chr$(10) + KotlerCommon3 + Chr$(10) + Chr$(10) + KotlerCommon4
Messagebox OutMsg, 0, MarketSegmentationTitle
End Sub
Public Sub MarketingMixMessage()
Dim OutMsg As String
OutMsg = MarketingMixMsg + Chr$(10) + Chr$(10) + KotlerCommon1 + Chr$(10) + Chr$(10) + _
KotlerCommon2 + Chr$(10) + Chr$(10) + KotlerCommon3 + Chr$(10) + Chr$(10) + KotlerCommon4
Messagebox OutMsg, 0, MarketingMixTitle
End Sub
Public Sub MarketingPlanMessage()
Dim OutMsg As String
OutMsg = MarketingPlanMsg + Chr$(10) + Chr$(10) + KotlerCommon1 + Chr$(10) + Chr$(10) + _
KotlerCommon2 + Chr$(10) + Chr$(10) + KotlerCommon3 + Chr$(10) + Chr$(10) + KotlerCommon4
Messagebox OutMsg, 0, MarketingPlanTitle
End Sub
Public Sub MeetingMessage()
Dim OutMsg As String
OutMsg = MeetingMsg1 + Chr$(10) + Chr$(10) + MeetingMsg2 + Chr$(10) + _
Chr$(10) + MeetingMsg3 + Chr$(10) + Chr$(10) + MeetingMsg4 + Chr$(10) + _
Chr$(10) + MeetingMsg5 + Chr$(10) + Chr$(10) + MeetingMsg6
Messagebox OutMsg, 0, MeetingTitle
End Sub
Public Sub PositioningMessage()
Dim OutMsg As String
OutMsg = PositioningMsg1 + Chr$(10) + Chr$(10) + PositioningMsg2
Messagebox OutMsg, 0, PositioningTitle
End Sub
Public Sub QualityImprovementMessage()
Dim OutMsg As String
OutMsg = QualityImprovementMsg1 + Chr$(10) + Chr$(10) + QualityImprovementMsg2 + Chr$(10) + Chr$(10) + _
QualityImprovementMsg3 + Chr$(10) + QualityImprovementMsg4 + Chr$(10) + QualityImprovementMsg5 + _
Chr$(10) + QualityImprovementMsg6 + Chr$(10) + QualityImprovementMsg7 + Chr$(10) + Chr$(10) + _
QualityImprovementMsg8
Messagebox OutMsg, 0, QualityImprovementTitle
End Sub
Public Sub SalesByKenWaxMessage()
Dim OutMsg As String
OutMsg = SalesByKenWaxMsg1 + Chr$(10) + Chr$(10) + SalesByKenWaxMsg2
Messagebox OutMsg, 0, SalesByKenWaxTitle
End Sub
Public Sub SalesByZiglarMessage()
Dim OutMsg As String
OutMsg = SalesByZiglarMsg1 + Chr$(10) + Chr$(10) + SalesByZiglarMsg2 + Chr$(10) + Chr$(10) + _
SalesByZiglarMsg3
Messagebox OutMsg, 0, SalesByZiglarTitle
End Sub
Public Sub StrategicAllianceMessage()
Dim OutMsg As String
OutMsg = StrategicAllianceMsg1 + Chr$(10) + Chr$(10) + StrategicAllianceMsg2 + Chr$(10) + _
Chr$(10) + StrategicAllianceMsg3 + Chr$(10) + Chr$(10) + StrategicAllianceMsg4
Messagebox OutMsg, 0, StrategicAllianceTitle
End Sub
Public Sub StrategicPlanMessage()
Dim OutMsg As String
OutMsg = StrategicPlanMsg1 + Chr$(10) + Chr$(10) + StrategicPlanMsg2 + Chr$(10) + Chr$(10) + _
StrategicPlanMsg3 + Chr$(10) + StrategicPlanMsg4 + Chr$(10) + StrategicPlanMsg5 + Chr$(10) + _
StrategicPlanMsg6 + Chr$(10) + StrategicPlanMsg7 + Chr$(10) + Chr$(10) + _
StrategicPlanMsg8
Messagebox OutMsg, 0, StrategicPlanTitle
End Sub
Public Sub TrainingMessage()
Dim OutMsg As String
OutMsg = TrainingMsg1 + Chr$(10) + Chr$(10) + TrainingMsg2 + Chr$(10) + _
Chr$(10) + TrainingMsg3 + Chr$(10) + TrainingMsg4 + Chr$(10) + _
TrainingMsg5 + Chr$(10) + Chr$(10) + TrainingMsg6
Messagebox OutMsg, 0, TrainingTitle
End Sub
'//-----------------------------------------------------------------------------------------------------------------------
'// Scripts for More Info Buttons
'//-----------------------------------------------------------------------------------------------------------------------
Public Sub MoreITStrategyInfo()
Messagebox ITStrategyInfo, 0, MoreInformationTitle
Selection.ClearSelection
End Sub
Public Sub MoreKotlerInfo()
Messagebox KotlerInfo, 0, MoreInformationTitle
Selection.ClearSelection
End Sub
Public Sub MorePositioningInfo()
Messagebox PositioningInfo, 0, MoreInformationTitle
Selection.ClearSelection
End Sub
Public Sub MoreQualityImprovementInfo()
Messagebox QualityImprovementInfo, 0, MoreInformationTitle
Selection.ClearSelection
End Sub
Public Sub MoreSalesByKenWaxInfo()
Messagebox SalesByKenWaxInfo, 0, MoreInformationTitle
Selection.ClearSelection
End Sub
Public Sub MoreSalesByZiglarInfo()
Messagebox SalesByZiglarInfo, 0, MoreInformationTitle
Selection.ClearSelection
End Sub
Public Sub MoreStrategicPlanInfo()
Dim OutMsg As String
OutMsg = StrategicPlanInfo1 + Chr$(10) + Chr$(10) + StrategicPlanInfo2 + Chr$(10) + StrategicPlanInfo3 + _
Chr$(10) + StrategicPlanInfo4 + Chr$(10) + StrategicPlanInfo5
Messagebox OutMsg, 0, MoreInformationTitle
Selection.ClearSelection
End Sub
'//-------------------------------------------------------------------------------------
'// Drop symbol 9 of textbox.sym
'//-------------------------------------------------------------------------------------
Public Sub DropStarBurst
Dim NewSym As DrawObject
Set NewSym = CurrentPage.CreateSymbol([Freelance].Preferences.TemplateDir + "textbox.sym", 8)
NewSym.Move 1000,1000
Selection.ClearSelection
End Sub
'//-------------------------------------------------------------------------------------
'// Fill in Team Members
'//-------------------------------------------------------------------------------------
Public Sub FillTeamMembers
Dim TeamTxtBlk As DrawObject
Set TeamTxtBlk = CurrentPage.FindObject(TeamMembersPBName)
TeamTxtBlk.TextBlock.Text = TeamMembersText
Selection.ClearSelection
End Sub
'//-------------------------------------------------------------------------------------
'// Drop 'X' on page
'//-------------------------------------------------------------------------------------
Public Sub DropX
Dim NewSym As DrawObject
Set NewSym = CurrentPage.CreateSymbol([Freelance].Preferences.TemplateDir + "buttons.sym", 1)
NewSym.Stretch 0, 0, 100, 100, 11, 11, 1
NewSym.Move 10900,5100
Selection.ClearSelection
End Sub
'//-------------------------------------------------------------------------------------
'// Launch browser off a button
'//-------------------------------------------------------------------------------------
Public Sub LaunchTextBox
CurrentPage.CreateSymbol [Freelance].Preferences.TemplateDir + "textbox.sym"
Selection.ClearSelection
End Sub
'//----------------------------------------------------------------------------------------
'// Routines for Agenda scripts
'//----------------------------------------------------------------------------------------
Private Sub SetAgenda(TextToInsert As String)
Dim AgendaTxtBlk As DrawObject, _
DummyTextBlk As DrawObject
Set AgendaTxtBlk = CurrentPage.FindObject(AgendaPBName)
Set DummyTextBlk = Currentpage.CreateText(1000,1000,1000,1000)
DummyTextBlk.Textblock.Text = "temp"
AgendaTxtBlk.Insert(DummyTextBlk)
Forall Object In currentpage.objects
If(Object.TextBlock.text = "temp") Then
Object.TextBlock.text = TextToInsert
Object.TextBlock.EnterEditMode
Exit Forall
End If
End Forall
End Sub
Public Sub BenefitsPlanAgenda()
SetAgenda(BenefitsPlanAgndTxt)
End Sub
Public Sub BusinessPlanAgenda()
SetAgenda(BusinessPlanAgndTxt)
Print BusinessPlanAgndTxt
End Sub
Public Sub BrainStormingAgenda()
SetAgenda(BrainStormingAgndTxt)
End Sub
Public Sub BusinessReviewAgenda()
SetAgenda(BusinessReviewAgndTxt)
End Sub
Public Sub CompensationPlanAgenda()
SetAgenda(CompensationPlanAgndTxt)
End Sub
Public Sub CompetitorAgenda()
SetAgenda(CompetitorAgndTxt)
End Sub
Public Sub CorporateOverviewAgenda()
SetAgenda(CorporateOverviewAgndTxt)
End Sub
Public Sub IndustryAgenda()
SetAgenda(IndustryAgndTxt)
End Sub
Public Sub ITAgenda()
SetAgenda(ITAgndTxt)
End Sub
Public Sub MarketingMixAgenda()
SetAgenda(MarketingMixAgndTxt)
End Sub
Public Sub MarketingPlanAgenda()
SetAgenda(MarketingPlanAgndTxt)
End Sub
Public Sub MarketResearchAgenda()
SetAgenda(MarketResearchAgndTxt)
End Sub
Public Sub MarketSegmentationAgenda()
SetAgenda(MarketSegmentationAgndTxt)
End Sub
Public Sub MarketStrategyAgenda()
SetAgenda(MarketStrategyAgndTxt)
End Sub
Public Sub NewMarketEntryAgenda()
SetAgenda(NewMarketEntryAgndTxt)
End Sub
Public Sub OrientationAgenda()
SetAgenda(OrientationAgndTxt)
End Sub
Public Sub PositioningAgenda()
SetAgenda(PositioningAgndTxt)
End Sub
Public Sub ProductServiceBriefingAgenda()
SetAgenda(ProductServiceBriefingAgndTxt)
End Sub
Public Sub ProductLaunchAgenda()
SetAgenda(ProductLaunchAgndTxt)
End Sub
Public Sub ProjectStatusReportAgenda()
SetAgenda(ProjectStatusReportAgndTxt)
End Sub
Public Sub ProposalAgenda()
SetAgenda(ProposalAgndTxt)
End Sub
Public Sub StrategicAllianceAgenda()
SetAgenda(StrategicAllianceAgndTxt)
End Sub
Public Sub SalesByKenWaxAgenda()
SetAgenda(SalesByKenWaxAgndTxt)
End Sub
Public Sub SalesByZiglarAgenda()
SetAgenda(SalesByZiglarAgndTxt)
End Sub
Public Sub TeamMeetingAgenda()
SetAgenda(TeamMeetingAgndTxt)
End Sub
Public Sub TrainingAgenda()
SetAgenda(TrainingAgndTxt)
End Sub
'//----------------------------------------------------------------------------------------
'// Script to print current page
'//----------------------------------------------------------------------------------------
Public Sub PrintCurrentPage()
Dim PrintRetVal As Integer
PrintRetVal = Messagebox(PrintMessage, MB_OKCANCEL, PrintMsgTitle)
If(PrintRetVal = IDOK) Then
CurrentDocument.Print CurrentPage.Number, CurrentPage.Number, 1
End If
Selection.ClearSelection
End Sub
'//-------------------------------------------------------------------------------------
'// Create Agenda item pages from agenda table contents
'//-------------------------------------------------------------------------------------
Public Sub CreatePagesFromAgenda()
Dim AgendaTableObj As Table, _
Cell As TextBlock, _
TitleTextBlk As TextBlock, _
ClockTextBlk As TextBlock, _
TitlePB As PlacementBlock, _
AgendaText(2 To 16, 1 To 8) As String, _
PageTitle As String, _
ColumnMessage As String, _
Row As Integer, _
Col As Integer, _
NumRows As Integer, _
NumCols As Integer, _
NumChars As Integer, _
RetVal As Integer, _
MaxRows As Integer
RetVal = Messagebox(CreateAgendaPagesMessage, MB_OKCANCEL, CreateAgendaPagesTitle)
Selection.ClearSelection
If(RetVal = IDOK) Then
Set AgendaTableObj = CurrentPage.FindObject(AgendaTableName)
NumCols = AgendaTableObj.ColCount
If(NumCols <> 3) Then '// user added/deleted columns, so to keep from unpredictable results
ColumnMessage = ColumnError1 + Chr$(10) + Chr$(10) + ColumnError2
Messagebox ColumnMessage, MB_OK, ErrorMsg
Else
Print "rows=",Numrows,"cols=",numcols
NumRows = 1
MaxRows = AgendaTableObj.RowCount
Print AgendaTableObj.name,maxrows, AgendaTableObj.RowCount
Set Cell = AgendaTableObj.GetCell(NumRows, 1) '// find number of filled in rows
While((Not Strcompare(Cell.Text, " ")) And (NumRows < MaxRows))
NumRows = NumRows + 1
Set Cell = AgendaTableObj.GetCell(NumRows, 1)
Print NumRows,cell.text
Wend
For Row = 2 To NumRows
Set Cell = AgendaTableObj.GetCell(Row, 1)
If(Not Strcompare(Cell.Text, " ")) Then
Set Cell = AgendaTableObj.GetCell(Row, 1)
For Col = 1 To AgendaTableObj.ColCount
Set Cell = AgendaTableObj.GetCell(Row, Col)
AgendaText(Row, Col) = Cell.Text
Print row,col,agendatext(row,col)
Next Col
End If
Next Row
For Row = 2 To NumRows
PageTitle = ""
For Col = 2 To NumCols
If(Col = NumCols) Then
PageTitle = PageTitle + AgendaText(Row, Col)
Else
PageTitle = PageTitle + AgendaText(Row, Col) + ", "
End If
Next Col
Print Row,PageTitle
CurrentDocument.CreatePageFromTemplate PageTitle, TemplateIndex
Set TitleTextBlk = CurrentPage.CreateText(1000, 1000, 1000, 1000)
TitleTextBlk.Text = PageTitle
Set TitlePB = CurrentPage.FindObject(AgendaItemTitlePBName)
TitlePB.Insert TitleTextBlk
Set ClockTextBlk = CurrentPage.FindObject(AgendaItemClockTxtName)
ClockTextBlk.Text = AgendaText(Row, 1)
Print row, ClockTextblk.text
Next Row
End If
End If
End Sub
'//-------------------------------------------------------------------------------------
'// Column fill scripts
'//-------------------------------------------------------------------------------------
Private Sub ColumnFill(ColumnName As String, FillText As String)
Dim ColObj As DrawObject
Print FillText
Set ColObj = CurrentPage.FindObject(ColumnName)
ColObj.TextBlock.Text = FillText
Sendkeys "^{END}"
End Sub
Public Sub FillStrengthsColumn()
ColumnFill StrengthsColumnPBName, StrengthsColumnText
End Sub
Public Sub FillWeaknessesColumn()
ColumnFill WeaknessesColumnPBName, WeaknessesColumnText
End Sub
Public Sub FillThreatsColumn()
ColumnFill ThreatsColumnPBName, ThreatsColumnText
End Sub
Public Sub FillOpportunitiesColumn()
ColumnFill OpportunitiesColumnPBName, OpportunitiesColumnText
End Sub
Public Sub FillGoodNewsColumn()
ColumnFill GoodNewsColumnPBName, GoodNewsColumnText
End Sub
Public Sub FillBadNewsColumn()
ColumnFill BadNewsColumnPBName, BadNewsColumnText
End Sub
Public Sub FillPaidColumn()
ColumnFill PaidPBName, PaidColumnText
End Sub
Public Sub FillUnpaidColumn()
ColumnFill UnpaidPBName, UnpaidColumnText
End Sub
Public Sub FillEntryColumn()
ColumnFill EntryPBName, EntryColumnText
End Sub
Public Sub FillExitColumn()
ColumnFill ExitPBName, ExitColumnText
End Sub
'//----------------------------------------------------------------------------------------
'// Routines to launch symbol or diagram browser with specified sym or dgm file
'//----------------------------------------------------------------------------------------
Private Sub LaunchSymBrowser(SymbolFile As String)
Dim SymPB As DrawObject
Set SymPB = CurrentPage.FindObject(SymPBName)
SymPB.PlacementBlock.BrowseSymbols([Freelance].Preferences.TemplateDir + SymbolFile)
End Sub
Private Sub LaunchDgmBrowser(DiagramFile As String)
Dim DgmPB As DrawObject
Set DgmPB = CurrentPage.FindObject(SymPBName)
DgmPB.PlacementBlock.BrowseDiagrams([Freelance].Preferences.TemplateDir + DiagramFile)
End Sub
Public Sub AgendaSymbol()
LaunchSymBrowser("agenda.sym")
End Sub
Public Sub CartoonSymbol()
LaunchSymBrowser("cartoons.sym")
End Sub
Public Sub ClosureSymbol()
LaunchSymBrowser("closure.sym")
End Sub
Public Sub CommunicationSymbol()
LaunchSymBrowser("communic.sym")
End Sub
Public Sub FinanceSymbol()
LaunchSymBrowser("finance.sym")
End Sub
Public Sub MedicalSymbol()
LaunchSymBrowser("medical.sym")
End Sub
Public Sub NextStepSymbol()
LaunchSymBrowser("nextstep.sym")
End Sub
Public Sub PeopleSymbol()
LaunchSymBrowser("people.sym")
End Sub
Public Sub ProjectSymbol()
LaunchSymBrowser("project.sym")
End Sub
Public Sub SalesSymbol()
LaunchSymBrowser("sales.sym")
End Sub
Public Sub ScienceSymbol()
LaunchSymBrowser("science.sym")
End Sub
Public Sub TextBoxSymbol()
LaunchSymBrowser("textbox.sym")
End Sub
Public Sub TimeSymbol()
LaunchSymBrowser("time.sym")
End Sub
Public Sub GraphDiagram()
LaunchDgmBrowser("graph.dgm")
Sendkeys"{DOWN}{DOWN}"
End Sub
Public Sub FlowDiagram()
LaunchDgmBrowser("flow.dgm")
End Sub
Public Sub GanttDiagram()
LaunchDgmBrowser("gantt.dgm")
End Sub
Public Sub EndScript()
End
End Sub
'// Finds specified timeline event stored in TimeLineInfo
'//--------------------------------------------------------------------------------
PRIVATE FUNCTION SelectEvent(index As Integer, TimeLineInfo() As GoalsStruct) As DrawObject
ForAll Object in Selection.SelectedObjects
If(Object.isText AND Object.left = TimeLineInfo(index).position) Then
set SelectEvent = Object
Exit ForAll
End If
End ForAll
END FUNCTION
'//--------------------------------------------------------------------------------
'// Add/Delete Timeline Event Script
'//--------------------------------------------------------------------------------
'// sets new coordinates for events - does not store text
'//--------------------------------------------------------------------------------
PRIVATE SUB FindTimelineTextShapes(TimeLineInfo() As GoalsStruct)
Dim Index As Integer, _
Count As Integer, _
i As Integer, _
j As Integer
For i = 1 To (MaxTimeLineEvents+2) '// zero out all position information
TimeLineInfo(i).Position = 0 '// in case it has info about old diagrams
Next i
Count = 1
ForAll Object in Selection.SelectedObjects
If(Object.IsText) Then '// sorts by left coordinate of each text shape found
Index = Count - 1
If(Count <> 1) Then
While((TimeLineInfo(Index).Position > Object.Left) AND (Index > 0))
TimeLineInfo(Index+1).Position = TimeLineInfo(Index).Position
Index = Index - 1
Wend
End If
TimeLineInfo(Index+1).Position = Object.Left
Count = Count + 1
End If
End ForAll
END SUB
'// Main TimeLine routine
'//--------------------------------------------------------------------------------
PUBLIC SUB Timeline()
Dim PackedVal As Long, _
DgmPath As String, _
NumEvents As Integer, _
Count As Integer, _
DefaultButton As Integer, _
x As Integer, _
NumToAdd As Integer, _
NumToDel As Integer, _
i As Integer, _
Index As Integer, _
MaxTextBlocks As Integer, _
MinTextBlocks As Integer, _
MaxSpinnerVal As Integer, _
TimeLine As DrawObject, _
Temp As DrawObject, _
TimeLineInfo(MaxTimeLineEvents+2) As GoalsStruct '// Add 2 for text blocks on timeline
MaxTextBlocks = MaxTimeLineEvents + 2 '// Add 2 for text blocks on timeline
MinTextBlocks = MinTimeLineEvents + 2
For x = 1 to MaxTextBlocks '// Init array of GoalsStruct's
TimeLineInfo(x).Position = 0
TimeLineInfo(x).Text = NULLSTR
Next x
Selection.ClearSelection
Set Temp = CurrentPage.FindObject(TimeLineDgmName) '// find timeline diagram
Set TimeLine = Temp.Replicate() '// take dgm out of pb to ungroup
Temp.Cut '// delete dgm in pb
Selection.ClearSelection
TimeLine.Ungroup '// ungroup dgm copied - not in pb
print Selection.selectioncount
If(Selection.SelectionCount < (MinTimeLineEvents + OtherTimeLineObjCount) OR _
Selection.SelectionCount > (MaxTimeLineEvents + OtherTimeLineObjCount)) Then
MessageBox InvalidDiagram, 0, ErrorMsg
EndScript
End If '// Checking for invalid diagram
SELECT Case(Selection.SelectionCount) '// Find number of timeline events
Case 6: NumEvents = 3
Case 7: NumEvents = 4
Case 8: NumEvents = 5
Case 9: NumEvents = 6
Case 10: NumEvents = 7
Case 11: NumEvents = 8
END SELECT
If(NumEvents = MaxTimeLineEvents) Then '// if max number of events, then default to delete an event
DefaultButton = 1
Else '// otherwise default to add
DefaultButton = 0
End If
Count = 1
ForAll Obj In Selection.SelectedObjects '// finds text shapes and stores text
If(Obj.IsText) Then '// sorts by left coordinate of each text shape found
Index = Count - 1
If(Count <> 1) Then
While((TimeLineInfo(Index).Position > Obj.Left) AND (Index > 0))
TimeLineInfo(Index+1) = TimeLineInfo(Index)
Index = Index - 1
Wend
End If
TimeLineInfo(Index+1).Position = Obj.Left
TimeLineInfo(Index+1).Text = Obj.Text
For x = 1 to Count
print timelineinfo(x).text, timelineinfo(x).position
next x
print "------------"
Count = Count + 1
End If
End ForAll
Set TimeLine = Selection.Group()
print "two"
DgmPath = [Freelance].Preferences.TemplateDir + TimelineDgmFileName
If(NumEvents = MaxTimeLineEvents) Then
MaxSpinnerVal = MaxTimeLineEvents
Else
MaxSpinnerVal = NumEvents + 1
End If
PackedVal = CurrentDocument.RunDialog(1, TLDlgTitle, DiagramNote, TLAddQuestion, TLDelQuestion, _
DefaultButton, NULLSTR, NULLSTR, "1", STR$(MaxSpinnerVal), 1, NumEvents)
If((PackedVal And BitField9) = BitField9) Then '// User ok'd dlg
If((PackedVal And BitField8) <> BitField8) Then '// ADD Goal
NumToAdd = PackedVal AND 255
If(NumEvents = MaxTimeLineEvents) Then '// too many events, can't add
MESSAGEBOX AddError, 0, ErrorMsg
TimeLine.PutIntoPlacementBlock(DgmPBID) '// assume pb has id of DgmID
TimeLine.Name = TimelineDgmName '// so we can find it later
Else '// add new event
TimeLine.Cut '// delete current event
Set TimeLine = CurrentPage.CreateSymbol(DgmPath, NumEvents-1)
Selection.ClearSelection
TimeLine.Ungroup
FindTimelineTextShapes TimeLineInfo() '// Find coordinates for each event and sort by position
for x = 1 to NumEvents+3
print Timelineinfo(x).text, Timelineinfo(x).position
next x
print "--------------------"
x = NumEvents + 3 '// add new event in array
While(x > NumToAdd+1)
TimeLineInfo(x).Text = TimeLineInfo(x-1).Text
x = x - 1
Wend
TimeLineInfo(NumToAdd+1).Text = "" '// not necessary since not used, but just to be safe
For x = 1 TO (NumToAdd) '// re-insert old events
Set Temp = SelectEvent(x, TimeLineInfo())
If(StrCompare(TimeLineInfo(x).Text, NULLSTR)) Then '// Don't replace with Null String, removes prompt text
Temp.Text = TimeLineInfo(x).Text
End If
Next x
for x = 1 to NumEvents+3
print Timelineinfo(x).text, Timelineinfo(x).position
next x
print "--------------------insert old events"
For x = (NumToAdd+2) TO (NumEvents+3)
Set Temp = SelectEvent(x, TimeLineInfo())
If(StrCompare(TimeLineInfo(x).Text, NULLSTR)) Then
Temp.Text = TimeLineInfo(x).Text
End If
Next x
Set TimeLine = Selection.Group() '// put pieces back together
TimeLine.PutIntoPlacementBlock(DgmPBID)
TimeLine.Name = TimelineDgmName '// so we can find it later
End If
Else '// delete event
NumToDel = PackedVal AND BitFields0To7
If(NumEvents = MinTimeLineEvents) Then
MESSAGEBOX DeleteError, 0, ErrorMsg
TimeLine.PutIntoPlacementBlock(DgmPBID) '// restore event in pb
TimeLine.Name = TimelineDgmName
ElseIf ((NumToDel <= NumEvents) AND (NumToDel > 0)) Then
TimeLine.Cut
Set TimeLine = CurrentPage.CreateSymbol(DgmPath, NumEvents-3)
Selection.ClearSelection
TimeLine.Ungroup
FindTimelineTextShapes TimeLineInfo() '// Find coordinates for each event and sort
For x = (NumToDel+1) To (NumEvents+1) '// delete event in array of GoalStruct's
TimeLineInfo(x).Text = TimeLineInfo(x+1).Text
Next x
TimeLineInfo(NumEvents+2).Text = "" '// clear last item in array
For x = 1 TO (NumEvents+1) '// re-insert old TimeLine
Set Temp = SelectEvent(x, TimeLineInfo())
If(StrCompare(TimeLineInfo(x).Text, NULLSTR)) Then
Temp.Text = TimeLineInfo(x).Text
End If
Next x
Set TimeLine = Selection.Group() '// put pieces back together
TimeLine.PutIntoPlacementBlock(DgmPBID)
TimeLine.Name = TimelineDgmName '// so we can find later
End If
End If
Else
TimeLine.PutIntoPlacementBlock(DgmPBID) '// user canceled out of dlg
TimeLine.Name = TimelineDgmName '// restore event in pb
End If
Selection.ClearSelection
END SUB