NC Clone

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Pcmodula
Posts: 10
Joined: Thu Nov 22, 2012 6:00 pm
Been thanked: 3 times

Re: NC Clone

Post by Pcmodula »

Yes, but now i wait for one SUV, not only a wheell.
Good job Jimmy 😀

Pcmodula

User avatar
AUGE_OHR
Posts: 712
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 89 times
Been thanked: 169 times

Post by AUGE_OHR »

hi,

i found Sample to Drag but it seem me not very good to work with Mouse whic have high DPI.
when move it "lost" what i want to Drag. i have to use smallest Mouse-DPI and move very slow.

other is a Drop Sample but it does not run under HMG even no other Include in PRG

Code: Select all

This.OnDropFiles := {| aFiles | ResolveDrop( "oWindow1", HMG_GetFormControls( "oWindow1" ), aFiles )}
HMG does not have OnDropFiles Event so it does not work. :(

---

that i have search for WS_EX_ACCEPTFILES but found none in HMG or MiniGUI :o
that i search for DragAcceptFiles but HMG have none :shock:

i MiniGUI i found HB_FUNC(DragAcceptFiles) but it have "other ParameterType"

Code: Select all

/*
   Harbour MiniGUI 1.4 Extended (Build 47)
   added by Grigory Filatov
 */
HB_FUNC( DRAGACCEPTFILES )
{
   DragAcceptFiles( ( HWND ) HB_PARNL( 1 ), hb_parl( 2 ) );
}

HB_FUNC( DRAGQUERYFILES )
{
   HDROP hDrop  = ( HDROP ) HB_PARNL( 1 );
   int   iFiles = DragQueryFile( hDrop, ( UINT ) -1, 0, 0 );
   int   i;
   char  bBuffer[ 250 ];

   hb_reta( iFiles );

   for( i = 0; i < iFiles; i++ )
   {
      DragQueryFile( hDrop, i, ( char * ) bBuffer, 249 );
      HB_STORC( ( char * ) bBuffer, -1, i + 1 );
   }
}

HB_FUNC( DRAGFINISH )
{
   DragFinish( ( HDROP ) HB_PARNL( 1 ) );
}
here it is upper HB_STORC() with 3 Parameter while hb_storc() have only 2 Parameter :?:
why is HB_PARNL( 1 ) upper :?:

here my Xbase++ Code using Ot4xb

Code: Select all

#include "ot4xb.ch"
#include "winuser_constants.ch"
//----------------------------------------------------------------
proc main  // Console
local hWnd := SetAppWindow():GetHWnd()
   ot4xb_subclasswindow(hWnd,MyHandler(),NIL,"Drop_wndproc")
   delegated_eval( {||@shell32:DragAcceptFiles(hWnd,1)} )
   while inkey(0) != 27
   end
return
//----------------------------------------------------------------
CLASS MyHandler
EXPORTED:
INLINE CLASS METHOD Drop_wndproc(hWnd,nMsg,wp,lp)
local p,cb,aFiles,n,nn
if nMsg == WM_DROPFILES
   nn := @shell32:DragQueryFileA(wp,-1,0,0)
   if nn > 0
      aFiles := Array(nn)
      p := _xgrab(260)
      for n := 1 to nn
         cb := @shell32:DragQueryFileA(wp,n-1,p,260)
         aFiles[n] := PeekStr(p,,cb)
      next
      _xfree(p)
      ? aFiles
      // or PostAppEvent(custom_event, aFiles,, oXbp)
   end
   return NIL
end
return NIL
ENDCLASS
as i understood HB_STORC() "read" like PeekStr() each file which are to drop.
under Xbase++ i use a Array to store File-List but how to in HMG

can someone help to re-write that Code for HMG :?:
have fun
Jimmy

User avatar
AUGE_OHR
Posts: 712
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 89 times
Been thanked: 169 times

Post by AUGE_OHR »

hi,

good News : i got ON MOUSEDRAG working :D

bad News ... seems "Codeblock" for Event can only "set" once

Code: Select all

  ON MOUSEMOVE DragMoveL() ;
  ON MOUSEDRAG DragHereL(ThisWindow.Name ,WinLeft.Grid_1.Value) ;
  
  ON MOUSEMOVE DragMoveR() ;
  ON MOUSEDRAG DragHereR(ThisWindow.Name,WinRight.Grid_1.Value) ;
it work fine when DragDrop from left to right
Left2right.jpg
Left2right.jpg (197.37 KiB) Viewed 662 times
but it fail when DragDrop from right to left ... it say "from left" :(
right2left.jpg
right2left.jpg (199.03 KiB) Viewed 662 times
as you see i try to use it for each WINDOW PANEL
when put it in MAIN ... hm ...
have fun
Jimmy

User avatar
AUGE_OHR
Posts: 712
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 89 times
Been thanked: 169 times

Post by AUGE_OHR »

hi,
Pcmodula wrote:
Wed Jan 22, 2020 8:08 pm
Yes, but now i wait for one SUV, not only a wheell.
i have begin with my Xbase++ Version 2008 and i have made 215 Version since Start
so i will take some time to "re-engine" it for harbour.

for me it it more than "one Tool" as Filemanager.

as we use DBF press F3 to view and F4 to edit DBF.
same with TXT. RFT or HTML
Image only use F3

with REGCLASS i can set my "favorite" setting

so i intergrade all i need when work on unknown PC with xBase.

i will not be a SUV, it will be a Spacetruck like Tesla Cybertruck ;)

---

Darkmode does mean for me that all Controls "can" be black ... than it can be every Color :idea:
as you see my HMG Sample there are a lot "not black" so i have to look if HMG have a Solution e.g. OWNERDRAW

btw. when have Rebar and Toolbar i set ReBar Color and Toolbar Transparent to get it Black.

Question : how to disable Visual Style for a single Control (not hole App) :?:
have fun
Jimmy

User avatar
AUGE_OHR
Posts: 712
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 89 times
Been thanked: 169 times

Post by AUGE_OHR »

hi,

i made progess with DragDrop and SHELLFILEOPERATION after found Sample
c:\MiniGUI\SOURCE\shell32\
F5_COPY.jpg
F5_COPY.jpg (127.85 KiB) Viewed 650 times
it will work with HMG while Function Structure is include

Code: Select all

#pragma BEGINDUMP
#include <windows.h>
#include "hbapi.h"

HB_FUNC ( SHELLFILEOPERATION )
{
   SHFILEOPSTRUCT sh;

   sh.hwnd   = (HWND) hb_parnl(1);
   sh.pFrom  = hb_parc(2);
   sh.pTo    = hb_parc(3);
   sh.wFunc  = hb_parnl(4);
   sh.fFlags = hb_parnl(5);
   sh.hNameMappings = 0;
   sh.lpszProgressTitle = NULL;

   hb_retnl( SHFileOperation (&sh) );
}

#pragma ENDDUMP
Tip for CLICK : put all HB_FUNC into HB_FUNC.PRG which CLICK do not touch

these SHFileOperation are what Explorer use so it include it´s Animation which you will see when have big Files.
still have some small BUG but Concept "seems" to work now how i want. :D
have fun
Jimmy

User avatar
AUGE_OHR
Posts: 712
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 89 times
Been thanked: 169 times

Post by AUGE_OHR »

hi,

here now Alpha Version 0.010
HBFM010.jpg
HBFM010.jpg (269.65 KiB) Viewed 602 times
working :
F5 (DragDrop), F7 and F8
ALT-F1 (left Combobox) ALT-F2 (right Combobox)

---
Question : how to "use" HMG Combobox with Mouse :idea:
now it only work with ONENTER so have to press ENTER Key ... or react in ONCLOSE
---

when copy large File you will see Explorer Animation ;)

you can Run "all" like in Explorer as it use same ShellExecute() API

DragDrop will use "COPY". it only work with both GRID.
there is no Animation yet when Drag but when Drop AskDialog appear.

you can not DragDrop from "outside" into App ...
still working on DRAGACCEPTFILES for HMG ( work with MiniGUI )

btw. this kind of DragDrop use a "Filelist" and not OLE so it will not work to DragDrop a Outlook Attachment to your App

---

now after all work with 2 x GRID i have to Destroy all and re-write for multiple TAB / GRID

under Xbase++ using OOP i "just" call a new Instance and each have there "own Variable"
now i need a Array to hold Information and must use ASCAN() to "identify" which GRID is using and got Information.

if you like to testdrive it here it is
HBFM010.zip
(1.28 MiB) Downloaded 30 times
will be continue ...
have fun
Jimmy

User avatar
AUGE_OHR
Posts: 712
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 89 times
Been thanked: 169 times

Post by AUGE_OHR »

hi,

after Basic Function is working i want to add Image.

Problem : seems HMG does use Imagelist only "internal" for GRID Header :?:
there is no

Code: Select all

  DEFINE IMAGELIST imagelst_1 ;
like in MiniGUI which have

Code: Select all

c_imagelist.c 
h_imagelist.prg 
as MinuGUI use BCC i´m not sure if c_imagelist.c can compile with MinGW :?:
h_imagelist.prg need do modify some Code for HMG ... but what about GRID ...

will it accept Imagelist when use LVM_SETIMAGELIST :?:
does HMG GRID support LVIF_IMAGE :?:
does it work in VIRTUAL mode :?:

---

have "dynamic" add Second TAB ... and the work is as i expect ...

again i use a old Cl*pper Concept when i need n-Dimension of "Variable" (like in CLASS)

Code: Select all

#xtranslate aDir1       => Stack1\[nDimLeft, 1]
#xtranslate cGrid_1     => Stack1\[nDimLeft, 2]

#xtranslate aDir2       => Stack2\[nDimRight, 1]
#xtranslate cGrid_2     => Stack2\[nDimRight, 2]

STATIC nDimLeft    := 0
STATIC nDimRight   := 0
my "Variable" are replace with Array
as "Variable" is a Name it is better to read than a Number

Code: Select all

PRIVATE Stack1 := {}
PRIVATE Stack2 := {}
   ...
   SP_INIT()

FUNCTION SP_INIT()                                          // init STACK
   AADD( Stack1, ARRAY( 2 ) )
   nDimLeft := LEN(Stack1)
   AADD( Stack2, ARRAY( 2 ) )
   nDimRight := LEN(Stack2)
RETURN ( nDimLeft+nDimRight )                                              // return nThread
this is how i start and when add a new TAB with GRID i need to add

Code: Select all

      AADD( Stack1, ARRAY( 2 ) )
      nDimLeft := LEN(Stack1)
now i can use same "Variable" Name but it work with different Array Element.
same Technique work when have Multi Form with "GET" and working with Variable

so i can switch (with Mouse, how with Keyboard ? ) between TAB use use ON CHANGE Event

Code: Select all

DEFINE TAB Tab_Left ;
           OF WinLeft ;
           ON CHANGE Tab_Change_Left()
                    
PROCEDURE Tab_Change_Left()
   nDimLeft := WinLeft.Tab_Left.Value
RETURN                    
to get "Dimension" for right Array "Variable" :D

---

add :

Header sort Column
add new TAB with GRID
have fun
Jimmy

User avatar
AUGE_OHR
Posts: 712
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 89 times
Been thanked: 169 times

Post by AUGE_OHR »

hi,

i have re-paint Problem with (VIRTUAL) GRID on TAB > 1 :(

Code: Select all

   WinLeft.Tab_Left.AddPage( nPageNumber, cCaption, cImageName )

   cName := "Grid_" + LTRIM( STR( nPageNumber ) )
   DEFINE GRID &cName
      PARENT WinLeft
      DefLeftGrid()
   END GRID

   WinLeft.Tab_Left.AddControl( cName, nPagenumber, 30, 0 )
when move with Cursor Items appear and data are right and i can copy etc.
as i use VIRTUAL GRID i have this Line

Code: Select all

   ONQUERYDATA OnDataRequest( aDir_Left, ThisWindow.Name, This.Name )
as side Effect all ON KEY from Main does not work any more :shock:

---

i found c:\MiniGUI\SAMPLES\BASIC\Tab_2\

but it have no ONQUERYDATA ... it have "fix" data :!:
i can re-write Code to use "fix" data but AddItem() take (long) time when have 1.000.000 files in Folder.

so is there any other Solution :idea:
does it make Sence to try MiniGUI with that HMG Code (no FMG) :?:
have fun
Jimmy

User avatar
AUGE_OHR
Posts: 712
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 89 times
Been thanked: 169 times

Post by AUGE_OHR »

hi,

have try it with/without VIRTUAL but it was the same :(
as Data are correct it is a "re-paint" Problem :idea:

found a Solution for re-paint :D

Code: Select all

   ListView_RedrawItems( nHandle, 1, iMax )
---

i still not understand why "ON KEY" from Main does not work when using Tab.AddPage() / Tab.AddControl()

as on TAB is a GRID i use "ONKEY" from GRID now

Code: Select all

   CASE xKey == VK_T .AND. HMG_VirtualKeyIsPressed( VK_CONTROL )
      NewTab()
that work ... but give me 2 x TAB ...

btw. how to navigate with Keyboard between TABpage of a TAB :?:

have fount out why it fire 2 x TAB so it is working now like i want :D
have to make so more test before upload next Version
HBFM014.jpg
HBFM014.jpg (116.24 KiB) Viewed 545 times
Crtl-T new TAB
Combobox with Icon
show Volume and Disk Size

todo
does not change Combobox when switch TAB (on same side)
F8 when delete Files/Folder it might show "Cache" when read Directory() again so i have to exclude it.

btw. SMB2 "local Cache" since Windows 7
http://technet.microsoft.com/en-us/libr ... 10%29.aspx

Code: Select all

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Lanmanworkstation\Parameters

DirectoryCacheLifetime
FileNotFoundCacheLifetime
FileInfoCacheLifetime
set these Key to 0 (zero) to avoid those Problem on Workstation when work with xBase App.
have fun
Jimmy

User avatar
AUGE_OHR
Posts: 712
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 89 times
Been thanked: 169 times

Post by AUGE_OHR »

hi,

here multi TAB Version
HBFM017.zip
(1.29 MiB) Downloaded 22 times
i use Darkmode again to show some Problem.

i have re-write Code to @ x,y Style but it is the same with Tab.AddPage() / Tab.AddControl()

Code: Select all

   IF nDim = 1
      nRow := 55
      nCol := 0
      nHeight := 800 - 070
   ELSE
      nRow := 0
      nCol := 0
      nHeight := 800 - 050
   ENDIF
Pos and Size on TAB > 1 seems not to work as i expect ... what do i miss :idea:

Question : how to set Color to TAB / PAGE / Header / Body :idea:

---

when GRID is not full filled i try this

Code: Select all

   iMax := MAX(iMax , ListViewGetCountPerPage (nHandle) )
   iMax := MAX(iMax , 100)
   ListView_RedrawItems( nHandle, 1, iMax )

   DO EVENTS
even is i set it to 100 ti does not re-paint "more" :(

---

not sure if i had Problem with GRID Header before ... it does not re-paint on "1st time" ( TAB > 1 )
when switch between TAB on same side it appear

---

Question : how to switch between TAB on same side with Keyboard in harbour / HMG :idea:

i try Crtl-TAB but it does not react so i try ON KEY and this Code

Code: Select all

         IF nGridFocus = 1
            nTab := Getproperty( "WinLeft", "Tab_Left", "Value" )
            nTab ++
            IF nTab > nDimLeft
               nDimLeft := 1
            ELSE
               nDimLeft := nTab
            ENDIF
            WinLeft.Tab_Left.Value := nDimLeft
            WinLeft.Tab_Left.SetFocus

            Domethod( "WinLeft", cGrid_Left, "SetFocus" )
            Domethod( "WinLeft", cGrid_Left, "Refresh" )
i know that "active" Number is in TAB.Value
this work for TAB > 1 but when back on 1 it stay at 1 :cry:

is there a other Way to set Focus to "TAB Page 2" :?:

---

how to write with this with SetProperty() :idea:

Code: Select all

Win1.Tab1(1).Grid1.Value := 10
---

this all a small Problem and 2nd TAB is a Option so i will freeze 2nd TAB and work on it later.
other Basic Function like compare left/right are more important to work with it.

p.s. if someone have Question about some used Technique please open a new Thread, thx
have fun
Jimmy

Post Reply