Re: [libreoffice-users] Base macros

2024-03-28 Thread Robert Großkopf

Hi Edwin,

OK, so I tried to follow the instructions as best as I could, but no 
success. I've attached a demo version of what I've tried, with essential 
image files, in exactly the same relation they are in the full version. 
I've added the macro and an action button.


Attachments will be cut here. Send it directly to me per private mail.

Regards

Robert
--
Homepage: https://www.familiegrosskopf.de/robert


--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


Re: [libreoffice-users] Base macros

2024-03-27 Thread Edwin Humphries
OK, so I tried to follow the instructions as best as I could, but no 
success. I've attached a demo version of what I've tried, with essential 
image files, in exactly the same relation they are in the full version. 
I've added the macro and an action button.


Can someone tell me what I'm doing wrong?

On 26/03/2024 5:50 pm, Robert Großkopf wrote:

Hi Edwin,


Thank you. I should have clarified: the image that comes up on the
form is a size limited version of the actual file on the hard disk. 


This will be the problem: Where could you get the path to the original 
sized images?


Macro will work with a path to external images.


2. In each image button, under the additional information field,
write the name of the image control.


Don't know why an image button. Could be any button, which contains in 
additional information the name of the field with URL-information to 
the original image.


Regards

Robert

--

Regards,
Edwin Humphries
Mobile: 0435 672 457

I acknowledge the traditional Wodi Wodi custodians, their elders and 
customs, of the Dharawal lands on which I live.


"At every moment he beholdeth a wondrous world, a new creation, and 
goeth from astonishment to astonishment, and is lost in awe at the works 
of the Lord of Oneness." Bahá'u'lláh
"... humans are interesting. With all the wonders there are in the 
Universe, they invented boredom." Terry Pratchett, Hogfather
"The most beautiful thing we can experience is the mysterious. It is the 
source of all true art and all science. He to whom this emotion is a 
stranger, who can no longer pause to wonder and stand rapt in awe, is as 
good as dead: his eyes are closed." Albert Einstein
"Stuff your eyes with wonder ... live as if you'd drop dead in ten 
seconds. See the world. It's more fantastic than any dream made or paid 
for in factories." Ray Bradbury

--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


Re: [libreoffice-users] Base macros

2024-03-26 Thread Robert Großkopf

Hi Edwin,


Thank you. I should have clarified: the image that comes up on the
form is a size limited version of the actual file on the hard disk. 


This will be the problem: Where could you get the path to the original 
sized images?


Macro will work with a path to external images.


2. In each image button, under the additional information field,
write the name of the image control.


Don't know why an image button. Could be any button, which contains in 
additional information the name of the field with URL-information to the 
original image.


Regards

Robert
--
Homepage: https://www.familiegrosskopf.de/robert


--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


Re: [libreoffice-users] Base macros

2024-03-25 Thread Andrew Pitonyak

I have not dealt with Base for years now (say 15), but, I did create a database 
to track stuff that I own. The DB contained full scale images of the receipts. 
I did not do as our indicated, but, it does display properly scaled images in 
the image control. I took a look at the macros I wrote and I did nothing 
special in the macros (it seems)  to properly scale. 

My biggest error was to embed the entire full size image into the DB. 

I do have buttons that Add an Image (so select, load and store in DB), Delete 
an image (delete from DB), replace an image (so select from file system, then 
replace existing), and extract from the DB

I can directly email you a copy of an empy DB if it interests you, but I am not 
sure if it is useful or not. 

It sounds like you did it write, show a thumbnail stored in your DB and 
reference the actual file on disk. 

I am writing a database front end application in C++ and QT for specific 
collectibles and it will find the image using a naming scheme based on a 
catelog number (at least for the standard image). Probably a better solution. 

Andrew Pitonyak

On Monday, March 25, 2024 01:01 EDT, Edwin Humphries 
 wrote:
 Hi all,

I have a database consisting of several flat-file tables with associated
forms. They contain information about plants, including several photos
(up to 6) per form. They are currently 150*150 "thumbnails", but the
photos themselves are larger, sometimes much larger.

I would like to add a feature that allows a viewer to open the photo up
in a separate window to screen maximum. I have seen several macros
online that purport to do that, but with limited documentation, and
apparently suited only for one photo per form. Moreover, I have little
experience with scripted macros, in Base (or any other program, for that
matter).

Can anyone help with this?

--

Regards,
Edwin Humphries
Mobile: 0435 672 457

I acknowledge the traditional Wodi Wodi custodians, their elders and
customs, of the Dharawal lands on which I live.

"At every moment he beholdeth a wondrous world, a new creation, and
goeth from astonishment to astonishment, and is lost in awe at the works
of the Lord of Oneness." Bahá'u'lláh
"... humans are interesting. With all the wonders there are in the
Universe, they invented boredom." Terry Pratchett, Hogfather
"The most beautiful thing we can experience is the mysterious. It is the
source of all true art and all science. He to whom this emotion is a
stranger, who can no longer pause to wonder and stand rapt in awe, is as
good as dead: his eyes are closed." Albert Einstein
"Stuff your eyes with wonder ... live as if you'd drop dead in ten
seconds. See the world. It's more fantastic than any dream made or paid
for in factories." Ray Bradbury
--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy

 

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


Re: [libreoffice-users] Base macros

2024-03-25 Thread Edwin Humphries

Robert

Thank you. I should have clarified: the image that comes up on the form 
is a size limited version of the actual file on the hard disk. I called 
it a "thumbnail" as shorthand for that level of detail; Sorry.


So, seeing how I am an ingénue in the macro game, can I confirm the process?

1. Add as an embedded macro the following:
   SUB ShowLinkedContent(oEvent AS OBJECT)
    oDoc = ThisComponent
    DIM oButton AS OBJECT, oForm AS OBJECT, oField AS OBJECT,
   oShell AS OBJECT
    DIM stField AS STRING, stUrl AS STRING, stContent AS STRING
    DIM arUrl_Start()
    oButton = oEvent.Source.Model
    stField = oButton.Tag
    oForm = oButton.Parent
    oField = oForm.getByName(stField)
    stUrl = oField.BoundField.getString
    arUrl_Start = split(oDoc.Parent.Url,oDoc.Parent.Title)
    oShell = createUnoService("com.sun.star.system.SystemShellExecute")
    stContent = convertToUrl(arUrl_Start(0) + stUrl)
    oShell.execute(stContent,,0)
   END SUB

2. In each image button, under the additional information field, write
   the name of the image control.

Is that right?


On 25/03/2024 6:01 pm, Robert Großkopf wrote:

Hi Edwin,

How should an external viewer open another picture, which isn't linked 
in the form? A macro will open the thumbnails.


Link the original fotos to the form. Then take this procedure:

SUB ShowLinkedContent(oEvent AS OBJECT)
DIM oButton AS OBJECT, oForm AS OBJECT, oField AS OBJECT, oShell 
AS OBJECT

DIM stField AS STRING, stUrl AS STRING, stContent AS STRING
DIM arUrl_Start()
oButton = oEvent.Source.Model
stField = oButton.Tag
oForm = oButton.Parent
oField = oForm.getByName(stField)
stUrl = oField.BoundField.getString
arUrl_Start = split(oDoc.Parent.Url,oDoc.Parent.Title)
oShell = createUnoService("com.sun.star.system.SystemShellExecute")
stContent = convertToUrl(arUrl_Start(0) + stUrl)
oShell.execute(stContent,,0)
END SUB

Write the name of the image control to the additional information of 
the button, which should start this procedure.


Regards

Robert

--

Regards,
Edwin Humphries
Mobile: 0435 672 457

I acknowledge the traditional Wodi Wodi custodians, their elders and 
customs, of the Dharawal lands on which I live.


"At every moment he beholdeth a wondrous world, a new creation, and 
goeth from astonishment to astonishment, and is lost in awe at the works 
of the Lord of Oneness." Bahá'u'lláh
"... humans are interesting. With all the wonders there are in the 
Universe, they invented boredom." Terry Pratchett, Hogfather
"The most beautiful thing we can experience is the mysterious. It is the 
source of all true art and all science. He to whom this emotion is a 
stranger, who can no longer pause to wonder and stand rapt in awe, is as 
good as dead: his eyes are closed." Albert Einstein
"Stuff your eyes with wonder ... live as if you'd drop dead in ten 
seconds. See the world. It's more fantastic than any dream made or paid 
for in factories." Ray Bradbury

--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


Re: [libreoffice-users] Base macros

2024-03-25 Thread Robert Großkopf

Ho Edwin,

started the macro and recognized I havent declared oDoc.
Write after all the variables at first line:

oDoc = ThisComponent

Regards

Robert
--
Homepage: https://www.familiegrosskopf.de/robert


--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


Re: [libreoffice-users] Base macros

2024-03-25 Thread Robert Großkopf

Hi Edwin,

How should an external viewer open another picture, which isn't linked 
in the form? A macro will open the thumbnails.


Link the original fotos to the form. Then take this procedure:

SUB ShowLinkedContent(oEvent AS OBJECT)
DIM oButton AS OBJECT, oForm AS OBJECT, oField AS OBJECT, oShell AS 
OBJECT
DIM stField AS STRING, stUrl AS STRING, stContent AS STRING
DIM arUrl_Start()
oButton = oEvent.Source.Model
stField = oButton.Tag
oForm = oButton.Parent
oField = oForm.getByName(stField)
stUrl = oField.BoundField.getString
arUrl_Start = split(oDoc.Parent.Url,oDoc.Parent.Title)
oShell = createUnoService("com.sun.star.system.SystemShellExecute")
stContent = convertToUrl(arUrl_Start(0) + stUrl)
oShell.execute(stContent,,0)
END SUB

Write the name of the image control to the additional information of the 
button, which should start this procedure.


Regards

Robert
--
Homepage: https://www.familiegrosskopf.de/robert


--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


[libreoffice-users] Base macros

2024-03-24 Thread Edwin Humphries

Hi all,

I have a database consisting of several flat-file tables with associated 
forms. They contain information about plants, including several photos 
(up to 6) per form. They are currently 150*150 "thumbnails", but the 
photos themselves are larger, sometimes much larger.


I would like to add a feature that allows a viewer to open the photo up 
in a separate window to screen maximum. I have seen several macros 
online that purport to do that, but with limited documentation, and 
apparently suited only for one photo per form. Moreover, I have little 
experience with scripted macros, in Base (or any other program, for that 
matter).


Can anyone help with this?

--

Regards,
Edwin Humphries
Mobile: 0435 672 457

I acknowledge the traditional Wodi Wodi custodians, their elders and 
customs, of the Dharawal lands on which I live.


"At every moment he beholdeth a wondrous world, a new creation, and 
goeth from astonishment to astonishment, and is lost in awe at the works 
of the Lord of Oneness." Bahá'u'lláh
"... humans are interesting. With all the wonders there are in the 
Universe, they invented boredom." Terry Pratchett, Hogfather
"The most beautiful thing we can experience is the mysterious. It is the 
source of all true art and all science. He to whom this emotion is a 
stranger, who can no longer pause to wonder and stand rapt in awe, is as 
good as dead: his eyes are closed." Albert Einstein
"Stuff your eyes with wonder ... live as if you'd drop dead in ten 
seconds. See the world. It's more fantastic than any dream made or paid 
for in factories." Ray Bradbury

--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy