Skip to content

Commit

Permalink
Added previous/next text buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
brymck committed Oct 27, 2011
1 parent b5d1e4a commit e167d54
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
14 changes: 14 additions & 0 deletions Modules/Buttons.bas
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@ Private Sub AddButtons()
.Style = msoButtonCaption
End With

' Add previous text
With .Add(msoControlButton)
.Caption = "&Previous Text"
.OnAction = "PreviousText"
.Style = msoButtonCaption
End With

' Add next text
With .Add(msoControlButton)
.Caption = "&Next Text"
.OnAction = "NextText"
.Style = msoButtonCaption
End With

' Add regex search
' With .Add(msoControlButton)
' .Caption = "&Regex Search"
Expand Down
6 changes: 4 additions & 2 deletions Modules/ChangeText.bas
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ Public Sub NextText(Optional ByVal UseNext As Boolean = True)
' Set that we've found a shape
If shp.Id = CurrentShapeId Then Found = True

' If using previous shape, we should have already found it
If Not UseNext Then
If Found Then
' Select last text shape if it's available
If LastTextShape Is Not Nothing Then LastTextShape.Select
On Error Resume Next
LastTextShape.Select
Exit Sub
ElseIf HasText(shp) Then
' Set last text shape
Expand All @@ -45,5 +47,5 @@ Public Sub NextText(Optional ByVal UseNext As Boolean = True)
End Sub

Public Sub PreviousText()
IncText False
NextText False
End Sub
Binary file modified pp_yaku_zen.ppa
Binary file not shown.
Binary file modified pp_yaku_zen.ppt
Binary file not shown.

0 comments on commit e167d54

Please sign in to comment.