Does it exist somewhere? If not, it should be pretty easy to add to rdoc-sources... I''ll do it unless I hear from someone that it''s already done.
On Jan 9, 2005, at 3:02 PM, Joel VanderWerf wrote:> Does it exist somewhere? If not, it should be pretty easy to add to > rdoc-sources... I''ll do it unless I hear from someone that it''s > already done.Huh, I guess that one never got added; I don''t even see it in the rdoc-sources for FXRuby 1.0. If you''d like to knock this one out, that would be great, otherwise I''ll add it to the list of things to do...
Dear all FXRuby users
I''m writing to ask for a suggestion; I need to display some
documentation
in my FXRuby application for the user, nothing particularly complicate ..
till now my solution was to generate HTML pages and than, from the GUI, to
start a browser to load that HTML pages .. on windows this is quite easy
(''start doc\\index.html'' or something like this), while on
Linux I''ve
found around some code (in the FOX community page) to guess the browser
installed (Mozilla, Firefox, whatever) .. now, althought this is working,
I''m wondering if I really need to start an external application for my
user help .. I''ve seen in the examples of FXruby (the texteditor) that
help is shown as a simple dialog with text inside .. just wondering is
someone has worked on this and end up with some nice widgets and/or
suggestions ..
Thanks to all, Riccardo :)
--
Riccardo Giannitrapani
Dipartimento di Fisica - Room L1-14-BE
Universita` di Udine - Via delle Scienze, 206 Udine (Italy)
Tel (Office): +39-0432-558209
Home Page: http://www.fisica.uniud.it/~riccardo
ICQ# 86590904
I''ve made a very simple (and Spartan) help dialog using the following
code:
# sentences : an array of strings
def displayHelp(sentences)
w = 600
h = 400
centerX = self.x + (self.width/2)
centerY = self.y + (self.height/2)
originX = centerX-(w/2)
originY = centerY-(h/2)
dialog =
FXDialogBox.new(@app,"Help",DECOR_ALL,originX,originY,w,h)
#dialog.icon = @miniIcon
outFrame = FXVerticalFrame.new(dialog,LAYOUT_FILL_X|LAYOUT_FILL_Y)
topFrame = FXHorizontalFrame.new(outFrame,LAYOUT_FILL_X|LAYOUT_FILL_Y)
bottomFrame = FXHorizontalFrame.new(outFrame,LAYOUT_CENTER_X)
#list = FXList.new(topFrame,15,nil,0,LAYOUT_FILL_X)
list = FXList.new(topFrame,nil,0,LAYOUT_FILL_X|LAYOUT_FILL_Y)
list.font = FXFont.new(@app, "helvetica", 10, FONTWEIGHT_DEMIBOLD)
button=
FXButton.new(bottomFrame,"OK",nil,dialog,FXDialogBox::ID_ACCEPT)
sentences.each { | sentence | list.appendItem(sentence) }
dialog.show
dialog.execute
end
-----Original Message-----
From: fxruby-users-bounces@rubyforge.org
[mailto:fxruby-users-bounces@rubyforge.org] On Behalf Of Riccardo
Giannitrapani
Sent: Monday, January 10, 2005 9:32 AM
To: fxruby-users@rubyforge.org
Subject: [fxruby-users] Help widget: suggestion?
Dear all FXRuby users
I''m writing to ask for a suggestion; I need to display some
documentation
in my FXRuby application for the user, nothing particularly complicate ..
till now my solution was to generate HTML pages and than, from the GUI, to
start a browser to load that HTML pages .. on windows this is quite easy
(''start doc\\index.html'' or something like this), while on
Linux I''ve
found around some code (in the FOX community page) to guess the browser
installed (Mozilla, Firefox, whatever) .. now, althought this is working,
I''m wondering if I really need to start an external application for my
user help .. I''ve seen in the examples of FXruby (the texteditor) that
help is shown as a simple dialog with text inside .. just wondering is
someone has worked on this and end up with some nice widgets and/or
suggestions ..
Thanks to all, Riccardo :)
--
Riccardo Giannitrapani
Dipartimento di Fisica - Room L1-14-BE
Universita` di Udine - Via delle Scienze, 206 Udine (Italy)
Tel (Office): +39-0432-558209
Home Page: http://www.fisica.uniud.it/~riccardo
ICQ# 86590904
_______________________________________________
fxruby-users mailing list
fxruby-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/fxruby-users
Riccardo Giannitrapani wrote:> Dear all FXRuby users > > I''m writing to ask for a suggestion; I need to display some > documentation in my FXRuby application for the user, nothing > particularly complicate .. till now my solution was to generate HTML > pages and than, from the GUI, to start a browser to load that HTML > pages .. on windows this is quite easy (''start doc\\index.html'' or > something like this), while on Linux I''ve found around some code (in > the FOX community page) to guess the browser installed (Mozilla, > Firefox, whatever) .. now, althought this is working, I''m wondering if > I really need to start an external application for my user help .. I''ve > seen in the examples of FXruby (the texteditor) that help is shown as a > simple dialog with text inside .. just wondering is someone has worked > on this and end up with some nice widgets and/or suggestions ..In the app I''m currently working on, there are two things for help. There is a quick "tip" window (attached) for short info. It''s just FXText in tabs, run as a non-modal dlg. For more details, I have buttons and menus that link to web pages. On non-windows platforms, I make the user select a browser the first time, and store that in preferences. It would be nice to have a polished bunch of FXRuby widgets for help. -------------- next part -------------- class TipWindow < FXDialogBox TIP_DATA = [ [ "&General", "\ * These tips cover the operation of the program rather than the significance of the simulation objects. See the detailed model documents for that information. * You can copy text out of this tip window, and you can leave the window open while you work. " ], [ "Getting &Help", "\ * Hover the mouse over certain widgets (such as buttons, menu items, and fields) for short help messages. The help messages appear as text in the status line at the bottom of the current window and, in some cases, as floating windows near the mouse pointer. * Dialog boxes have help buttons for more detailed help. * The Help menu and buttons link to the HTML documents included with EvalTool. " ], [ "&Editing", "\ " ], [ "&Files", "\ " ], [ "&Mouse", "\ " ], [ "&Keyboard", "\ " ], [ "&Dialogs", "\ " ], [ "&Plot", "\ " ], [ "&Advanced", "\ " ], ] class TipItem def initialize(tabbook, caption, icon = nil, text = "", font = nil) tab = FXTabItem.new(tabbook, caption, icon, TAB_LEFT_NORMAL) body = FXHorizontalFrame.new(tabbook, FRAME_THICK|FRAME_RAISED) @textbox = FXText.new(body, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y) @textbox.editable = false @textbox.font = font if font @textbox.text = text end end ## should centralize fonts and have font prefs def tip_font @tip_font ||= FXFont.new(getApp(), "courier", 9) ##, FONTWEIGHT_BOLD) end def initialize(owner) super(owner, "EvalTool Tips", DECOR_ALL) register_pref_key "dialogs/tips" register_pref_var :x => 100, :y => 100, :height => 200, :width => 550 self.padLeft = self.padTop = self.padBottom = self.padRight = 2 tabbook = FXTabBook.new(self, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y) tabbook.tabStyle = TABBOOK_LEFTTABS TIP_DATA.each do |caption, text| TipItem.new(tabbook, caption, nil, text.tabto(0), tip_font) end end end
Hi to all thanks for replies and suggestions :) Riccardo On Mon, 10 Jan 2005 20:47:14 -0800, Joel VanderWerf <vjoel@path.berkeley.edu> wrote:> Riccardo Giannitrapani wrote: >> Dear all FXRuby users >> >> I''m writing to ask for a suggestion; I need to display some >> documentation in my FXRuby application for the user, nothing >> particularly complicate .. till now my solution was to generate HTML >> pages and than, from the GUI, to start a browser to load that HTML >> pages .. on windows this is quite easy (''start doc\\index.html'' or >> something like this), while on Linux I''ve found around some code (in >> the FOX community page) to guess the browser installed (Mozilla, >> Firefox, whatever) .. now, althought this is working, I''m wondering if >> I really need to start an external application for my user help .. I''ve >> seen in the examples of FXruby (the texteditor) that help is shown as a >> simple dialog with text inside .. just wondering is someone has worked >> on this and end up with some nice widgets and/or suggestions .. > > In the app I''m currently working on, there are two things for help. > There is a quick "tip" window (attached) for short info. It''s just > FXText in tabs, run as a non-modal dlg. > > For more details, I have buttons and menus that link to web pages. On > non-windows platforms, I make the user select a browser the first time, > and store that in preferences. > > It would be nice to have a polished bunch of FXRuby widgets for help.-- Riccardo Giannitrapani Dipartimento di Fisica - Room L1-14-BE Universita` di Udine - Via delle Scienze, 206 Udine (Italy) Tel (Office): +39-0432-558209 Home Page: http://www.fisica.uniud.it/~riccardo ICQ# 86590904
Riccardo, I found this was an easy way to show a ''help''
dialog, the
"formatting" is done via simple "\n" (new line) and
"+" char to continue
with the Message.
It displays a dialog message , waits till OK button pressed , then continues.
Cheers,
Brett
# ======================================================# H E
L P
# ======================================================pushbutton4=
FXButton.new(btnRow,''Help'' ,nil, nil, 0, BUTTON_NORMAL|
JUSTIFY_RIGHT )
pushbutton4.connect(SEL_COMMAND) do |sender, sel, checked|
# ## your button press code here ##
@statusbar.getStatusLine.setNormalText(''Show Help '')
FXMessageBox.information(self, MBOX_OK, "Rough Guide to #{SpamBGone}
",
" #{SpamBGone}#{SpamVersion} Copyright Brett S Hallett (c)2003 :
dragoncity@impulse.net.au " +
" \n \n" +
"To use #{SpamBGone} you must firstly have a Internet address with a
Internet
Service Provider\n" +
"and be connected,\n Spam-B-Gone then reads all your mail header info
(does
not read the mail)\n" +
"the headers are displayed to you in a table layout, you then
''tick'' the mail
you wish to be deleted \n" +
"on your ISP''s computer \n"+
" \n" +
"--> click ''Check Mail'' to read the mail headers
\n"+
" \n" +
"now ''click'' in the row of the Delete? column any mail
you wish to have
deleted, \n" +
"the text ''delete'' will appear, you may
''re-click'' to reset. \n" +
" \n" +
"--> click ''Process Deletes'' to have the selected
mail deleted \n"+
" \n" +
"--> if you ''Quit'' without clicking ''Process
Mail'' the selected mail is NOT
deleted \n" +
" \n" +
"#{SpamBGone} does not retain any information about your mail.\n" +
" \n" +
"Now collect your mail using your usual E-mail program. \n" +
"--> click ''Call Mail'' to start your Email program
(defaults to Kmail) \n"+
"\n")
@statusbar.getStatusLine.setNormalText('''')
end # pushbutton4
> Dear all FXRuby users
>
> I''m writing to ask for a suggestion; I need to display some
documentation
> in my FXRuby application for the user, nothing particularly complicate ..
> till now my solution was to generate HTML pages and than, from the GUI, to
> start a browser to load that HTML pages .. on windows this is quite easy
> (''start doc\\index.html'' or something like this), while
on Linux I''ve
> found around some code (in the FOX community page) to guess the browser
> installed (Mozilla, Firefox, whatever) .. now, althought this is working,
> I''m wondering if I really need to start an external application
for my
> user help .. I''ve seen in the examples of FXruby (the texteditor)
that
> help is shown as a simple dialog with text inside .. just wondering is
> someone has worked on this and end up with some nice widgets and/or
> suggestions ..
>
> Thanks to all, Riccardo :)
--
Cheers,
Brett S Hallett