AChoice GUI ... how ?
Moderator: Rathinagiri
- AUGE_OHR
- Posts: 2064
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
AChoice GUI ... how ?
hi,
the benefit of AChoice are 6th Parameter alCanSelect
under Xbase++ i have made a own CLASS FROM and use Ownerdraw for disable Item and hilight possible Device. now i think about a harbour / HMG Solution but it have no Owerdraw so i search for other Solution.
the Problem is how to make a Row "unselect-able"
ok i can check it at ON ENTER but i don´t want that User "canselect" e.g. "C:" to eject Device.
"not show" those Device is not a Option ...
so which Control to use ... GRID
i think ON CHANGE is the point to start and than ...
the benefit of AChoice are 6th Parameter alCanSelect
under Xbase++ i have made a own CLASS FROM and use Ownerdraw for disable Item and hilight possible Device. now i think about a harbour / HMG Solution but it have no Owerdraw so i search for other Solution.
the Problem is how to make a Row "unselect-able"
ok i can check it at ON ENTER but i don´t want that User "canselect" e.g. "C:" to eject Device.
"not show" those Device is not a Option ...
so which Control to use ... GRID
i think ON CHANGE is the point to start and than ...
have fun
Jimmy
Jimmy
Re: AChoice GUI ... how ?
Jimmy. I think for what you are asking,
I use a browse for scanning and a grid for working in.
I remember on one of your posts you said a grid and browse where the same, they are not.
They use the same functions but react different. Browse is much faster for scanning large tables or arrays.
I use a browse for scanning and a grid for working in.
I remember on one of your posts you said a grid and browse where the same, they are not.
They use the same functions but react different. Browse is much faster for scanning large tables or arrays.
All The Best,
Franco
Canada
Franco
Canada
- AUGE_OHR
- Posts: 2064
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Re: AChoice GUI ... how ?
have a look into
Code: Select all
C:\hmg.3.4.4\SOURCE\c_browse.c
C:\hmg.3.4.4\SOURCE\c_grid.c
the "Engine" is the same but it act in different Way.
the fastest Way is IMHO to use VIRTUAL where you "just" tell Window to "reserve Memory" with
Code: Select all
ITEMS aArray // must be PRIVATE or PUBLIC if change
ITEMCOUNT LEN( aArray )
i got a Solution which can be used
Code: Select all
STATIC PROCEDURE DoAction()
LOCAL nRow := This.CellRowIndex
LOCAL nType := VAL( Win_1.Grid_Device.CellEx( This.CellRowIndex, 2 ) )
LOCAL cDrive := aDrives[ nRow ] [ 2 ]
IF nType = DRIVE_REMOVABLE .OR. nType = DRIVE_CDROM
EjectMedia( cDrive, .T. )
ENDIF
RETURN
i still have Problem to include PREVENT_MEDIA_REMOVA Structure
https://docs.microsoft.com/de-de/window ... ia_removal
have fun
Jimmy
Jimmy
- AUGE_OHR
- Posts: 2064
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Re: AChoice GUI ... how ?
hi
i found this
https://autohotkey.com/board/topic/2862 ... sh-drive/
as bool can be 0 or 1 -> CHR(0) or CHR(1)
it seems to work but i have to make some more test
i found this
https://autohotkey.com/board/topic/2862 ... sh-drive/
this sample dow not use PREVENT_MEDIA_REMOVAL Structure as "is just a single bool"; Enables or disables the mechanism that ejects media, for those devices possessing that locking capability.
; Drivers keep track of the lock count, and thereby allow ANY caller to unlock a drive (not just the one that locked it). See more at http://msdn.microsoft.com/en-us/library/ms803649.aspxCode: Select all
PreventRemovalOfVolume(hVolume, fPreventRemoval) { ; struct PREVENT_MEDIA_REMOVAL is just a single bool PMRBuffer := chr(fPreventRemoval ? 1 : 0) return DeviceIoControl(hVolume, IOCTL_STORAGE_MEDIA_REMOVAL := 0x2D4804, PMRBuffer, 1) }
as bool can be 0 or 1 -> CHR(0) or CHR(1)
it seems to work but i have to make some more test
have fun
Jimmy
Jimmy
- danielmaximiliano
- Posts: 2612
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
- Contact:
Re: AChoice GUI ... how ?
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
- AUGE_OHR
- Posts: 2064
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Re: AChoice GUI ... how ?
hi,
USB 3x is very fast so Microsoft have change Way and disable Cache but you still can enable it.
User can "un-plug" USB-Device while copy ... there is no Way to react on it
but if you have a Software to "eject" it must check if you can do it "now" or try it later
here is my 1st harbour / HMG Version
this Article describe how Cache is working but it does not help when "eject" USB Stick "while copy".danielmaximiliano wrote: ↑Fri Feb 07, 2020 1:37 pm See : https://docs.microsoft.com/en-us/window ... rage-media
USB 3x is very fast so Microsoft have change Way and disable Cache but you still can enable it.
User can "un-plug" USB-Device while copy ... there is no Way to react on it
but if you have a Software to "eject" it must check if you can do it "now" or try it later
here is my 1st harbour / HMG Version
have fun
Jimmy
Jimmy
- AUGE_OHR
- Posts: 2064
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Re: AChoice GUI ... how ?
hi,
here is a Sample what i mean i copy a large file to (slow) USB-Stick.
while copy file i try to "eject" USB-Stick with App and that must "react" and refuse it
my workaround for PREVENT_MEDIA_REMOVAL seem to work ... but it seem "to stay in Memory" ...
i have to re-start App to "reset" my workaround for next try ...
so i still have to ask how to work with Windows Structure under harbour / HMG.
this Tool make no sence if it don`t work 100% correct
here is a Sample what i mean i copy a large file to (slow) USB-Stick.
while copy file i try to "eject" USB-Stick with App and that must "react" and refuse it
my workaround for PREVENT_MEDIA_REMOVAL seem to work ... but it seem "to stay in Memory" ...
i have to re-start App to "reset" my workaround for next try ...
so i still have to ask how to work with Windows Structure under harbour / HMG.
this Tool make no sence if it don`t work 100% correct
have fun
Jimmy
Jimmy
- AUGE_OHR
- Posts: 2064
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Re: AChoice GUI ... how ?
hi
i think i made big success with Thread and PUBLIC Variable
now i use Field-wide STATIC instead of PUBLIC and i get close to what i want.
attach Sample where you can see that it work even if Form have "no focus" (Tasktray )
it need some time to detect DBT_DEVICEARRIVAL but it does immediately react on DBT_DEVICEREMOVECOMPLETE
i think i made big success with Thread and PUBLIC Variable
Code: Select all
STATIC caItems := {} // for GRID
STATIC acImage := {} // for GRID
STATIC aDrives
attach Sample where you can see that it work even if Form have "no focus" (Tasktray )
it need some time to detect DBT_DEVICEARRIVAL but it does immediately react on DBT_DEVICEREMOVECOMPLETE
have fun
Jimmy
Jimmy