Edit Extended / Edit WorkArea - ABM / ABM2

Topic Specific Tutorials and Tips.

Moderator: Rathinagiri

nassausky
Posts: 21
Joined: Wed Nov 18, 2009 4:41 pm

Edit Extended / EDIT WORKAREA - ABM / ABM2

Post by nassausky » Fri Aug 27, 2010 8:44 pm

EDIT EXTENDED OPTIONS

I noticed in the EDIT EXTENDED command that there is a parameter called OPTIONS with a type of <aOptions> . What are the aOptions?

Can I have EDIT EXTENDED automatically jump to a particular record row as it is opened?
_________________
Sincerely,

Mike

User avatar
esgici
Posts: 4508
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 386 times
Been thanked: 111 times
Contact:

Post by esgici » Fri Aug 27, 2010 10:27 pm

nassausky wrote:I noticed in the EDIT EXTENDED command that there is a parameter called OPTIONS with a type of <aOptions> . What are the aOptions?
Hello Mike

Regarding ...\hmg\SOURCE\EDITEX\h_edit_ex.prg :
* [aOptions] Matriz de 2 niveles. el primero de tipo texto es la descripción
* de la opción. El segundo de tipo bloque de código es la opción
* a ejecutar cuando se selecciona. Si no se pasa esta variable,
* se desactiva la lista desplegable de opciones.
from Google :
An array of 2 levels. The first type is the description text
* Of the option. The second type of code block is the option
* To execute when selected. If this variable is not passed,
* Disables the drop-down list of options.
And in the ...\hmg\SAMPLES\EDIT.EXTENDED\demo.prg neatly sampled using of this feature.

In summary : "options" is not a predefined command option, it's a user define-able feature to add.
nassausky wrote:Can I have EDIT EXTENDED automatically jump to a particular record row as it is opened?
As far as know there isn't such "automatic" feature. But in the sample there is a "find" option. You can simply add a "go to" option like this. Or by using "options".

I hope that this will help you :)

Happy HMG'ing :D

Regards

--

Esgici
Viva INTERNATIONAL HMG :D

nassausky
Posts: 21
Joined: Wed Nov 18, 2009 4:41 pm

Post by nassausky » Sun Aug 29, 2010 3:14 pm

That was a great example! I am able to port it over to my application but I have a question again. It doesn't seem to be functioning in a single line for example:

Code: Select all

EDIT EXTENDED OPTIONS {"Execute Option 1",{|| MsgInfo("Here I will have it do something")}}
_________________
Sincerely,

Mike

User avatar
esgici
Posts: 4508
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 386 times
Been thanked: 111 times
Contact:

Post by esgici » Sun Aug 29, 2010 3:28 pm

nassausky wrote:... It doesn't seem to be functioning in a single line ...
Hi Mike

I'm glad that you like it :)

May be require some other parameters :?

Without a working sample it's difficult to say something :(

Regards

--

Esgici
Viva INTERNATIONAL HMG :D

nassausky
Posts: 21
Joined: Wed Nov 18, 2009 4:41 pm

Post by nassausky » Mon Aug 30, 2010 2:03 am

OK here is the client.prg from SAMPLES/NETIO.02/CLIENT


I don't know why this DOES work good:

Code: Select all

#include <hmg.ch>

Function Main

        Load Window Main       //As opposed to Define Window Form_1;etc etc
        Main.Center
        Main.Activate

Return

//This next function is called in form file called main.prg
Function _Connect()
     Local c_STR_Con := "net:"
     Local aOptions := Array (1,2)

     aOptions[1,1] := "Execute option 1"
     aOptions[1,2] := {|| MsgInfo( "You can do something here 1" ) }
     
     
     
     c_STR_Con := c_STR_con + AllTrim(Main.Text_1.Value) + ":" ;
                            + AllTrim(Main.Text_3.Value) + ":" ;
					   + AllTrim(Main.Text_2.Value)

	if NETIO_CONNECT("127.0.0.1","2941")
	     Use &c_STR_Con
 	     EDIT EXTENDED OPTIONS aOptions
     endif

Return Nil

But this does NOT work below :(


Code: Select all

#include <hmg.ch>

Function Main

        Load Window Main       //As opposed to Define Window Form_1;etc etc
        Main.Center
        Main.Activate

Return

//This next function is called in form file called main.prg
Function _Connect()
     Local c_STR_Con := "net:"
     Local aOptions := Array (1,2)

     
     c_STR_Con := c_STR_con + AllTrim(Main.Text_1.Value) + ":" ;
                            + AllTrim(Main.Text_3.Value) + ":" ;
					   + AllTrim(Main.Text_2.Value)

	if NETIO_CONNECT("127.0.0.1","2941")
	     Use &c_STR_Con
   	     EDIT EXTENDED OPTIONS {"Execute Option 1",{|| MsgInfo("I will soon add a function here")}}
     endif

Return Nil

_________________
Sincerely,

Mike

User avatar
esgici
Posts: 4508
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 386 times
Been thanked: 111 times
Contact:

Post by esgici » Mon Aug 30, 2010 10:46 am

Hi Mike

For making your sample "working" :

- copied C:\hmg\SAMPLES\NETIO.02\Client\main.fmg
- copied C:\hmg\SAMPLES\NETIO.02\HmgNetIOServer\TEST.dbf and .dbt

Compiled separately two ( working and not ) parts of your program, and no difference noticed :(

Please be more specific about problem ( ie what is meaning of "not working", compile error, run time error or don't seen expected behavior ?).

And please give us really working sample with required files. I'm not sure my above copies are correct against your files.

Also I don't know does required any installation (and how) for NETIO server, before testing your sample.

We can help you by SSW (simple, short and working) samples only.

Regards

--

Esgici
Viva INTERNATIONAL HMG :D

nassausky
Posts: 21
Joined: Wed Nov 18, 2009 4:41 pm

Post by nassausky » Mon Aug 30, 2010 2:58 pm

Oh I am sorry for not being clear. It's probably a very simple answer too. It doesn't matter what application. I just want to see if I can get EDIT EXTENDED to show a message like "HELLO" in a message box after they select it in the options drop down box.

An easier example is just taking the SAMPLE\EDIT.1\ with no extra files.. Just making one simple change to the DEMO.PRG

Change line 23 from:

ITEM "&Simple Edit test" ACTION EDIT ...........

and replacing it with this line:

ITEM "&Simple Edit test" ACTION EDIT EXTENDED OPTIONS {"OPTION1",{|| MsgInfo("Under construction")}}


Now basically it should open up the extended edit browse window and on the right side under the OPTIONS drop down box it should show the word OPTION1 and after you click on it then a msg box should pop up saying Under Construction.

Am I thinking correctly? Is this right?

Thanks again
_________________
Sincerely,

Mike

User avatar
esgici
Posts: 4508
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 386 times
Been thanked: 111 times
Contact:

Post by esgici » Mon Aug 30, 2010 3:58 pm

Hi Mike

Finally, I understood :!:

( Sorry for late understanding :( )

Problem is :

ITEM "&Simple Edit test" ACTION EDIT EXTENDED OPTIONS { {"OPTION1",{|| MsgInfo("Under construction")}} }

Regards

--

Esgici
Viva INTERNATIONAL HMG :D

nassausky
Posts: 21
Joined: Wed Nov 18, 2009 4:41 pm

Post by nassausky » Mon Aug 30, 2010 4:50 pm

Great, that is exactly what I wanted. I am surprised it uses so many braces/brackets. I have to figure out why it uses extra { and }.


Thanks again!
_________________
Sincerely,

Mike

User avatar
esgici
Posts: 4508
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 386 times
Been thanked: 111 times
Contact:

Post by esgici » Mon Aug 30, 2010 4:56 pm

nassausky wrote:I am surprised it uses so many braces/brackets. I have to figure out why it uses extra { and }.
No so many nor extra, they are necessary.

How you will add a second (and more) options ?

Regards

--

Esgici
Viva INTERNATIONAL HMG :D

Post Reply