| To: | "'omar tazi'" <omar_tazi1979@hotmail.com>, <s-news@lists.biostat.wustl.edu> |
|---|---|
| Subject: | Re: Splus |
| From: | "Richard Pugh" <rpugh@mango-solutions.com> |
| Date: | Tue, 29 Apr 2003 16:05:42 +0100 |
| Importance: | Normal |
| In-reply-to: | <LAW12-F92ohteCtGobe0000e3bb@hotmail.com> |
| Organization: | Mango Solutions |
| Reply-to: | <Rpugh@mango-solutions.com> |
|
Hi Omar, Do you mean menu dialogs in the Windows version? There are 2 ways ... 1) In S-PLUS (for Windows) ... * Go to the object explorer * Right click on the left-hand panel and "insert folder" * Right click the folder - choose "Advanced" * Select "MenuItem" from the interface objects * Expand the "Splusmenubar" option in the resulting directory structure * Right click and "Insert menu item ..." where you want it * Change type to "Menuitem", action to "Function", then add your function on the "Commands" tag * Look at the menu system - you should see the new menu item 2) Look at the history window after doing the above. There is some code created starting with "guiCreate" and "guiModify". The Programmer's Guide (chapter 17) has more info on building menu systems with this language. 3?) Personally I don't like the guiCreate functionality - it comes from the old Axum side. Instead, I have a piece of code that takes an Excel file, translates it to "guiCreate" code, then kicks it all off - much easier to edit. If you're doing this, get an Excel file with separate worksheets (1 for pages, 1 for groups, 1 for "normal" properties, and 1 for menu items). Name each column with the resulting argument name in the function call. Then for each page do something like this :- # Set up property file property.file <- "CCWgraphprop.dft" # Get the Excel data Menu.Normals <- importData("MenuSystem.xls", pageNumber=3, stringsAsFactors=F, startCol=2, startRow=2, endCol=11) names(Menu.Normals) <- c("Type", "Name", "DialogControl", "DialogPrompt", "DefaultValue", "OptionList", "Disable", "IsRequired", "UseQuotes") # Normal Properties for (i in 1:nrow(Menu.Normals)) { Test <- !is.na(Menu.Normals[i,]) & (Menu.Normals[i,] != "") Local.Menu <- Menu.Normals[i,Test, drop=T] My.com.1 <- paste(names(Local.Menu), unlist(Local.Menu), sep=" = '", collapse = "' , ") eval(parse(text=(paste("guiCreate('Property', ", My.com.1, "', SavePathName = property.file)", sep="")))) } Very neat - it means that you just have to edit an Excel file as opposed to looking through (usually very long) "guiCreate" scripts … Hope this helps, Rich. Mango Solutions Tel : (01628) 418134 Mob : (07967) 808091
-----Original Message----- Hello, How can I create dialog windows with Splus? Thank you for answering. _________________________________________________________________ Pro ou perso, toutes les adresses et numéros de tél que vous cherchez -------------------------------------------------------------------- This message was distributed by s-news@lists.biostat.wustl.edu. To unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with the BODY of the message: unsubscribe s-news --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.456 / Virus Database: 256 - Release Date: 18/02/2003
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|