Reference Book

Reference Book - Handbook Home, Back, and Copy buttons don't work - Сообщения

#1 Опубликовано: 18.10.2013 13:58:29
KHomola

KHomola

2 сообщений из 3 понравились пользователям.

Группа: User

In the Handbook included in the Reference Book (portable version), the Home button appears to do nothing. The Back button works like hitting the backspace key. The copy button seems to work correctly. Excellent handbook by the way.

Using Windows version
1 пользователям понравился этот пост
Martin Kraska 18.10.2013 15:20:00
#2 Опубликовано: 18.10.2013 15:19:38
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Wrote

In the Handbook included in the Reference Book (portable version), the Home button appears to do nothing. The Back button works like hitting the backspace key. The copy button seems to work correctly. Excellent handbook by the way.

Using Windows version


Thanks for the feedback.

Some of these problems may be due to the fact that the external handbook pages are in edit mode. One can switch them to read only state in the file properties dialog but I am not going to do that manually for more than 400 pages. Here, some sort of batch file would be handy, to do the required source mod automatically. This also would enable following links just by clicking them instead of CTRL-Click. Volunteers to write such a script are welcome. I promise to apply it to the pages before publishing them in the portable distribution. One could even think of an export filter for TortoiseSVN.

Currently, the handbook is just a reverse engineered extension to the built-in math reference book without any official support by the main program, except some editing improvements in the last smath update in summer.

In the future, I would recommend/expect:
- jumping to the corresponding function description using F1 if on a function name (much like invoking the dynamic assistant using F12
- Seach capability within documents and in the help system
- Better support for editing links (currently, this is xml source editing)
- Sort of automatic table of contents based on directory hierarchy (currently, all up-, down- and crosslinking is done manually)
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#3 Опубликовано: 18.10.2013 19:02:57
Davide Carpi

Davide Carpi

1415 сообщений из 2872 понравились пользователям.

Группа: Moderator

Wrote

Some of these problems may be due to the fact that the external handbook pages are in edit mode. One can switch them to read only state in the file properties dialog but I am not going to do that manually for more than 400 pages.


You can do it easily using this program: FAR

Because the attribute is optional, you need to enable the at leat one time the read-only attribute manually (for new pages) or using FAR (2nd screenshot; be careful with tabs, to avoid issues copy and paste the code from a sm file)


best regards,

Davide
2013-10-19 01_13_36-Find And Replace.png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 пользователям понравился этот пост
Martin Kraska 19.10.2013 06:37:00
#4 Опубликовано: 18.10.2013 19:50:06
KHomola

KHomola

2 сообщений из 3 понравились пользователям.

Группа: User

Here's a script to make the .SM files in a folder read-only (both the file-system attribute and SMath attribute)

It's actually two scripts, the .bat file calls the .vbs and they must be in the same folder. I'm sure it could be done from one .vbs but I didn't want to take the time.

Usage: MakeAllSMfilesReadOnly

where is the full path and name of the folder containing the .sm files to make read-only

I assigned a right-click Send To command shortcut to it so I can just right-click the folder and Send to, Make SM files read only.

In case I cannot attach the files the code is also included below. Code is between separators ===...

MakeAllSMfilesReadOnly.bat
===========================================
@echo off
:: This script makes an SMath file read-only by adding the string false
:: to the section. This is the same as File, Properties, File Attributes, Read-only in SMath
Title=Make all SMath files in folder %1 read-only...
set spath=%~dp0
:: Might need to uncomment below for older systems
rem setlocal EnableExtensions
set ATTR=%~a1
set DIRATTR=%ATTR:~0,1%
rem endlocal
:: If %1 is a folder then continue
if /i "%DIRATTR%"=="d" (
echo.
echo Are you sure? [read title of this window - Ctrl-C to cancel]
echo.
pause
%~d1
cd %1
setlocal EnableDelayedExpansion
for /f "delims=|" %%i IN ('dir /b %1\*.sm') DO (
set smfile="%%i"
echo.
echo Processing file [ %%i ]...
echo.
For /F "Delims=" %%j In ('Attrib !smfile!') Do Set _Attribs=%%j
:: Remove read-only attribute, if set
If "!_Attribs:~5,1!"=="R" Attrib -R !smfile!
cscript "%spath%read-only-sm-file.vbs" !smfile!
:: Set read-only attribute
Attrib +R !smfile!
)
endlocal
) else (
echo.
echo %1 is NOT a folder
echo.
)
pause
:EOF
===========================================

read-only-sm-file.vbs
===========================================
' Modify SMath .sm file to make it read-only

Const ForReading = 1
Const ForWriting = 2

strFileName = Wscript.Arguments(0)
strOldText = "" & vbCrLf & " "
strNewText = "" & vbCrLf & " false" & vbCrLf & " "

On Error Resume Next
lngCount = Wscript.Arguments(3)
If Err.Number <> 0 Then lngCount = -1
On Error Goto 0

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strFileName, ForReading)
strText = objFile.ReadAll
objFile.Close

If Instr(1, strText, strOldText) > 0 Then
strNewText = Replace(strText, strOldText, strNewText, 1, lngCount)
Set objFile = objFSO.OpenTextFile(strFileName, ForWriting)
objFile.Write strNewText 'WriteLine adds extra CR/LF
objFile.Close
End If
===========================================
1 пользователям понравился этот пост
Martin Kraska 19.10.2013 06:37:00
#5 Опубликовано: 19.10.2013 13:40:07
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Thanks for the scripts. I just tried them (without the system attribute change part):

- links are activated by click instead of ctrl-click
- Buttons in the reference manual window are inactive

But:
- Nothing is re-calculated
- Plot regions are empty
- computed links (e.g. in the plugin index) are not updated according to the given installation
- Manual re-calculation does not work.

It might be a matter of taste, if this is an improvement. My personal preference is to still have an "active" book with the ctrl-click-drawback.

Andrey, do you see an option to resolve this?
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#6 Опубликовано: 03.02.2016 12:43:46
vldmrrr

vldmrrr

0 сообщений из 2 понравились пользователям.

Группа: User

Still no love for back button after two years. In current version (0.97) the buttons in included Reference book work as expected, but not in the "Interactive SMath Handbook".

Judging from the above discussion, the interactive nature of the handbook is not supported by design of the application. Is that correct? If so, maybe adding a specific feature request is justified?
#7 Опубликовано: 03.02.2016 15:10:57
Martin Kraska

Martin Kraska

1222 сообщений из 2150 понравились пользователям.

Группа: Moderator

Wrote

Still no love for back button after two years. In current version (0.97) the buttons in included Reference book work as expected, but not in the "Interactive SMath Handbook".

Judging from the above discussion, the interactive nature of the handbook is not supported by design of the application. Is that correct? If so, maybe adding a specific feature request is justified?



The interactive handbook is based on reverse engineering of the built-in math reference book. Andrey has supported the interactive handbook by implementing some improvements for handling text regions with links. Davide's text region utilities helped a lot in simpler writing of handbook pages.

There is a function index, where all the pages have file names matching the function names. Thus, in principle, Andrey could offer you to open the appropriate file if you press F1 when the cursor is on a function name. But that is not implemented.
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
Davide Carpi 03.02.2016 19:54:00
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений