Platforms to show: All Mac Windows Linux Cross-Platform
Required plugins for this example: MBS MacOSX Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacOSX/Summary
This example is the version from Sun, 17th Mar 2012.
Project "Summary.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control EditField1 Inherits TextArea
ControlInstance EditField1 Inherits TextArea
End Control
Control EditField2 Inherits TextArea
ControlInstance EditField2 Inherits TextArea
End Control
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action()
run
End EventHandler
End Control
Control Slider1 Inherits Slider
ControlInstance Slider1 Inherits Slider
EventHandler Sub ValueChanged()
run
End EventHandler
End Control
Control EditField3 Inherits TextArea
ControlInstance EditField3 Inherits TextArea
End Control
Control Popup Inherits PopupMenu
ControlInstance Popup Inherits PopupMenu
EventHandler Sub Change()
dim ParagraphCount as integer = s.ParagraphCount
dim SentenceCount as integer = s.SentenceCount
if me.ListIndex<0 then
EditField3.text = ""
elseif me.ListIndex < ParagraphCount then
EditField3.text = s.ParagraphAtIndex(me.ListIndex)
else
EditField3.text = s.SentenceAtIndex(me.ListIndex-ParagraphCount)
end if
End EventHandler
End Control
EventHandler Sub Open()
run
End EventHandler
Protected Sub run()
s = new SummaryMBS(EditField1.text)
EditField2.text = s.SentenceSummaryString(Slider1.Value)
dim RankOrderOfSentences(-1) as integer = s.RankOrderOfSentences
dim SentenceIndexOfSentences(-1) as integer = s.SentenceIndexOfSentences
dim ParagraphIndexOfSentences(-1) as integer = s.ParagraphIndexOfSentences
dim RankOrderOfParagraphs(-1) as integer = s.RankOrderOfParagraphs
dim ParagraphIndexOfParagraphs(-1) as integer = s.ParagraphIndexOfParagraphs
dim ParagraphCount as integer = s.ParagraphCount
for ParagraphIndex as integer = 0 to ParagraphCount - 1
popup.AddRow "Paragraph "+str(ParagraphIndex+1)+", rank "+str(RankOrderOfParagraphs(ParagraphIndex))
popup.RowTag(popup.ListCount-1)=ParagraphIndex
next
dim SentenceCount as integer = s.SentenceCount
for SentenceIndex as integer = 0 to SentenceCount - 1
popup.AddRow "Sentence "+str(SentenceIndex+1)+", rank "+str(RankOrderOfSentences(SentenceIndex))+", paragraph "+str(ParagraphIndexOfSentences(SentenceIndex))
popup.RowTag(popup.ListCount-1)=SentenceIndex
next
End Sub
Property Protected s As SummaryMBS
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
End Project
The items on this page are in the following plugins: MBS MacOSX Plugin.