Re: Coloured button background

2016-09-01 Thread Jody Bevan
Mitch:

I think the way to get all that you want is to create an SVG object. Within 
this Object we had a two column pallet of buttons, where the users could: 
change the colours, and on the fly we could change background colour, text 
colour, text style. They could have popular or not on the fly. It would be very 
possible to have a picture for the SVG.

On the fly they could be made visible or invisible.

Sincerely
Jody Bevan

> On Sep 1, 2016, at 18:37, Mitchell Shiller  wrote:
> 
> Merci Arnaud… mais  (but)
> 
> Custom buttons do not allow you to have a popup menu feature.  So I can get 
> most of what I want but not all.
> BTW, it is not to hard to create my own- using a text variable and the form 
> events:On Mouse Enter, On Mouse Leave and On Clicked.  I can create a 
> highlight effect when the object is rolled over. I add two picture variables 
> one for the icon and one for the popup- hide them if not in use.  It is a 
> pain to name all of the objects but..c’est la vie.
> 
> Thanks
> 
> Mitch
> 
> 
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Coloured button background

2016-09-01 Thread Mitchell Shiller
Merci Arnaud… mais  (but)

Custom buttons do not allow you to have a popup menu feature.  So I can get 
most of what I want but not all.
BTW, it is not to hard to create my own- using a text variable and the form 
events:On Mouse Enter, On Mouse Leave and On Clicked.  I can create a highlight 
effect when the object is rolled over. I add two picture variables one for the 
icon and one for the popup- hide them if not in use.  It is a pain to name all 
of the objects but..c’est la vie.

Thanks

Mitch

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Named selection based List Box

2016-09-01 Thread Chuck Miller
You betcha and as a named selection sorting stays. I have used it as well.

Regards

Chuck

 Chuck Miller Voice: (617) 739-0306
 Informed Solutions, Inc. Fax: (617) 232-1064   
mailto:cjmillerinformed-solutions.com 
 Brookline, MA 02446 USA Registered 4D Developer
   Providers of 4D and Sybase connectivity
  http://www.informed-solutions.com  



> On Aug 31, 2016, at 4:33 PM, John Baughman  wrote:
> 
> List Box has been getting a great deal of discussion and one thing I have 
> noticed is that the Named Selection based list box is rarely mentioned and on 
> at least one occasion was referred to as not being of much use.
> 
> I recently had the requirement for a form that included 3 lists displaying 
> different selections from the same table. In the past I would have used 
> arrays in either list boxes or ALPro areas. This time I decided to give Named 
> Selection based list boxes a try and was pleasantly surprised how easy it was 
> to setup and maintain.  
> 
> If I had used arrays, with each list displaying 6 fields I would have had to 
> create and maintain more than 18 arrays. With Named Selections I could do the 
> same thing without any arrays. Changing the selections is a simple matter of 
> clearing the Named Selection for each list box and creating a new one. Way 
> less code than would be required to update 3 sets of arrays.
> 
> So much easier, and very powerful.

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Trapping for 'not a valid object'

2016-09-01 Thread Lee Hinde
Thanks Tim; that's great.

As a side note, it's interesting that I frequently get html responses to
error pages from apis that would otherwise return json. Like many of us,
they assume everything will work.

On Thu, Sep 1, 2016 at 11:03 AM, Timothy Penner  wrote:

> Hi Lee,
>
> I think what you are looking for is this:
> http://kb.4d.com/assetid=77555
>
> ===
>
>
> Tech Tip: How to check if TEXT is an OBJECT / JSON
> PRODUCT: 4D | VERSION: 15.2 | PLATFORM: Mac & Win
> Published On: June 23, 2016
>
> Here is a utility method that can be used to check if some TEXT represents
> a valid OBJECT / JSON:
>
>
> // UTIL_IS_TEXT_AN_OBJECT
> // $1 := TEXT of JSON to check
> // $0 := BOOLEAN representing validitity
> If (Count parameters=1)
>C_BOOLEAN($0)
>C_TEXT($method;$result;$1)
>$method:=Method called on error
>ON ERR CALL(Current method name)
>$result:=JSON Stringify(JSON Parse($1))
>ON ERR CALL($method)
>If ($result="")
>   $0:=False
>Else
>   $0:=True
>End if
> Else
> // on err call
> // do nothing
> End if
>
>
> If this method is saved as UTIL_IS_TEXT_AN_OBJECT it could be used like
> this:
>
> C_TEXT($text)
> $text:="{\"OK\": true}"
> If (UTIL_IS_TEXT_AN_OBJECT ($text))
>C_OBJECT($ob)
>$ob:=JSON Parse($text;Is object)
> Else
>ALERT("$text is not an object")
> End if
>
>
> This is useful for checking arbitrary data before parsing it as an object
> because an error is generated if you attempt to parse invalid text as a
> object.
>
> ---
>
> -Tim PENNER
>
>
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Trapping for 'not a valid object'

2016-09-01 Thread Lee Hinde
On Thu, Sep 1, 2016 at 10:57 AM, Keisuke Miyako 
wrote:

>   //you parsed rubbish
>

I think that's the name of my next business.
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Datetime fields in 4D... (was: How to find 2 digit years in legacy..)

2016-09-01 Thread Benedict, Tom
A few days ago I responded to:



>>if a date field is created with legacy tools, can it be used it as a datetime?

>>And an hour field?



>Apparently so:

>

>C_DATE($dOutput)

>C_TIME($dtOutput)

>

>  // Misc is a table created using 4D legacy tool (structure editor)

>

>$sKey:="DateTime Test"

>Begin SQL

>insert into Misc (sKey, dDate) VALUES (:$sKey, CURRENT_TIMESTAMP());

>

>select dDate from Misc where sKey = :$sKey into :$dOutput -- yields the 
> date part: 08/31/16 End SQL



>Begin SQL

> select dDate from Misc where sKey = :$sKey into :$dtOutput  -- yields the 
> time part:  07:24:00 End SQL



>So my statement about needing to create the field with SQL commands is not 
>correct. If you fill a date field using SQL time >stamp 4D will store both the 
>date and time parts either of which may be retrieved using SQL, no matter how 
>the date field >was created.



I neglected to mention that once you add the time value to a 4D field (as 
described above) you can no longer use the equality comparator (=) in queries 
when you are querying with only a date.



If you run the above code to fill the date field with a datetime value the 
following query will fail:



 QUERY([Misc];[Misc]dDate=CURRENT DATE)



That is because 4D is including both the date and the time in the query and 
CURRENT date does include the time part.



So be careful if you start including time in your 4D date fields.



Tom Benedict

Optum Inc

This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: [resolved - Programmer BUG] Re: v13 - Object get Coordinates

2016-09-01 Thread Chip Scheide
I realized ... OF COURSE! 
in Client/Server, Apply to Selection will NOT be able to get 
coordinates!!!
as it executes ON THE SERVER, and can not see the open form on the 
client !

Duh.

On Thu, 1 Sep 2016 12:52:00 -0400, Chip Scheide wrote:
> I was calling the method which used Get Coordinates via APPLY TO 
> SELECTION 
> Some how, inside the apply to selection GET COORDINATES would not 
> return a value?!?!?!
> 
> Replacing the APPLY TO SELECTION with a For loop resolves the issue, 
> and Get Coordinates returns values as expected.
> 
> So... It might be wise, if you are using Get COordinates with APLY TO 
> SELECTION in v14 + to verify that this works as expected (you do 
> actually get coordinates).
> 
> 
> On Thu, 1 Sep 2016 12:41:18 -0400, Chip Scheide wrote:
>> as a followup - when I exit the method where there is a zero coordinate 
>> value he coordinates are again available.
>> 
>> On Thu, 1 Sep 2016 12:29:36 -0400, Chip Scheide wrote:
>>> any ideas as to why this command is returning all 0's ?
>>> 
>>> I am in a call chain:
>>> New process
>>>  Opened window
>>>   entry form (calendar)
>>>Form method
>>> Project method for form (on outside call)
>>>  redraw calendar
>>>   place boxes, day numbers etc *
>>>Place appointments/events *
>>> actually move text objects for appts/events **
>>> 
>>> * - In debugger (and in execution of code) : 
>>> OBJECT GET 
>>> 
>> 
> 
COORDINATES(*;$"Actual_Object_Name";$Box_Left;$Box_Top;$Box_Right;$Box_Bottom)
>>> all of these variables   $Box_Top;$Box_Right;$Box_Bottom  > 0
>>> 
>>> ** - In debugger (and in execution of code) :
>>> OBJECT GET 
>>> 
>> 
> 
COORDINATES(*;$"Actual_Object_Name";$Box_Left;$Box_Top;$Box_Right;$Box_Bottom)
>>> all of these variables   $Box_Top;$Box_Right;$Box_Bottom  **Equal** 0 
>>> (zero)
>>> 
>>> I do not understand how this is!
>>> Same form, same window, same process, same call chain, just one step 
>>> deeper
>>> The object exists! It was moved into its location in the step (above 
>>> call chain) 'place boxes, day numbers etc'.  I can see it being put 
>>> into place, while debugging!!
>>> 
>>> thanks
>>> Chip
>>> **
>>> 4D Internet Users Group (4D iNUG)
>>> FAQ:  http://lists.4d.com/faqnug.html
>>> Archive:  http://lists.4d.com/archives.html
>>> Options: http://lists.4d.com/mailman/options/4d_tech
>>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>>> **
>> **
>> 4D Internet Users Group (4D iNUG)
>> FAQ:  http://lists.4d.com/faqnug.html
>> Archive:  http://lists.4d.com/archives.html
>> Options: http://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: Trapping for 'not a valid object'

2016-09-01 Thread Timothy Penner
Hi Lee,

I think what you are looking for is this:
http://kb.4d.com/assetid=77555

===


Tech Tip: How to check if TEXT is an OBJECT / JSON
PRODUCT: 4D | VERSION: 15.2 | PLATFORM: Mac & Win
Published On: June 23, 2016

Here is a utility method that can be used to check if some TEXT represents a 
valid OBJECT / JSON:


// UTIL_IS_TEXT_AN_OBJECT
// $1 := TEXT of JSON to check
// $0 := BOOLEAN representing validitity
If (Count parameters=1)
   C_BOOLEAN($0)
   C_TEXT($method;$result;$1)
   $method:=Method called on error
   ON ERR CALL(Current method name)
   $result:=JSON Stringify(JSON Parse($1))
   ON ERR CALL($method)
   If ($result="")
  $0:=False
   Else 
  $0:=True
   End if 
Else 
// on err call
// do nothing
End if


If this method is saved as UTIL_IS_TEXT_AN_OBJECT it could be used like this:

C_TEXT($text)
$text:="{\"OK\": true}"
If (UTIL_IS_TEXT_AN_OBJECT ($text))
   C_OBJECT($ob)
   $ob:=JSON Parse($text;Is object)
Else 
   ALERT("$text is not an object")
End if


This is useful for checking arbitrary data before parsing it as an object 
because an error is generated if you attempt to parse invalid text as a object.

---

-Tim PENNER
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Trapping for 'not a valid object'

2016-09-01 Thread Keisuke Miyako
C_OBJECT($o)

ON ERR CALL("ERR")
$o:=JSON Parse("rubbish";Is object)
ON ERR CALL("")

If (Not(OB Is defined($o)))

  //you parsed rubbish

End if


> 2016/09/02 2:39、Lee Hinde  のメール:
>
> I think the answer is an On Err Call, but...
> If I do something like:  JSON Parse($response;Is object)
> Is there some way to trap if the response isn't a valid json object?



宮古 啓介
セールス・エンジニア

株式会社フォーディー・ジャパン
〒150-0043
東京都渋谷区道玄坂1-10-2 渋谷THビル6F
Tel: 03-6427-8441
Fax: 03-6427-8449

keisuke.miy...@4d.com
www.4D.com/JP

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Trapping for 'not a valid object'

2016-09-01 Thread Lee Hinde
I realized I'm looking for try/except... Never mind.


On Thu, Sep 1, 2016 at 10:39 AM, Lee Hinde  wrote:

> I think the answer is an On Err Call, but...
>
> If I do something like:  JSON Parse($response;Is object)
>
> Is there some way to trap if the response isn't a valid json object?
>
>
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Trapping for 'not a valid object'

2016-09-01 Thread Lee Hinde
I think the answer is an On Err Call, but...

If I do something like:  JSON Parse($response;Is object)

Is there some way to trap if the response isn't a valid json object?
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

[resolved - 4D BUG] Re: v13 - Object get Coordinates

2016-09-01 Thread Chip Scheide
I was calling the method which used Get Coordinates via APPLY TO 
SELECTION 
Some how, inside the apply to selection GET COORDINATES would not 
return a value?!?!?!

Replacing the APPLY TO SELECTION with a For loop resolves the issue, 
and Get Coordinates returns values as expected.

So... It might be wise, if you are using Get COordinates with APLY TO 
SELECTION in v14 + to verify that this works as expected (you do 
actually get coordinates).


On Thu, 1 Sep 2016 12:41:18 -0400, Chip Scheide wrote:
> as a followup - when I exit the method where there is a zero coordinate 
> value he coordinates are again available.
> 
> On Thu, 1 Sep 2016 12:29:36 -0400, Chip Scheide wrote:
>> any ideas as to why this command is returning all 0's ?
>> 
>> I am in a call chain:
>> New process
>>  Opened window
>>   entry form (calendar)
>>Form method
>> Project method for form (on outside call)
>>  redraw calendar
>>   place boxes, day numbers etc *
>>Place appointments/events *
>> actually move text objects for appts/events **
>> 
>> * - In debugger (and in execution of code) : 
>> OBJECT GET 
>> 
> 
COORDINATES(*;$"Actual_Object_Name";$Box_Left;$Box_Top;$Box_Right;$Box_Bottom)
>> all of these variables   $Box_Top;$Box_Right;$Box_Bottom  > 0
>> 
>> ** - In debugger (and in execution of code) :
>> OBJECT GET 
>> 
> 
COORDINATES(*;$"Actual_Object_Name";$Box_Left;$Box_Top;$Box_Right;$Box_Bottom)
>> all of these variables   $Box_Top;$Box_Right;$Box_Bottom  **Equal** 0 
>> (zero)
>> 
>> I do not understand how this is!
>> Same form, same window, same process, same call chain, just one step 
>> deeper
>> The object exists! It was moved into its location in the step (above 
>> call chain) 'place boxes, day numbers etc'.  I can see it being put 
>> into place, while debugging!!
>> 
>> thanks
>> Chip
>> **
>> 4D Internet Users Group (4D iNUG)
>> FAQ:  http://lists.4d.com/faqnug.html
>> Archive:  http://lists.4d.com/archives.html
>> Options: http://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: v13 - Object get Coordinates

2016-09-01 Thread Douglas von Roeder
Chip:

Check the syntax of the second parameter.

--
Douglas von Roeder
949-336-2902

On Thu, Sep 1, 2016 at 9:41 AM, Chip Scheide <4d_o...@pghrepository.org>
wrote:

> as a followup - when I exit the method where there is a zero coordinate
> value he coordinates are again available.
>
> On Thu, 1 Sep 2016 12:29:36 -0400, Chip Scheide wrote:
> > any ideas as to why this command is returning all 0's ?
> >
> > I am in a call chain:
> > New process
> >  Opened window
> >   entry form (calendar)
> >Form method
> > Project method for form (on outside call)
> >  redraw calendar
> >   place boxes, day numbers etc *
> >Place appointments/events *
> > actually move text objects for appts/events **
> >
> > * - In debugger (and in execution of code) :
> > OBJECT GET
> >
> COORDINATES(*;$"Actual_Object_Name";$Box_Left;$Box_Top;$Box_
> Right;$Box_Bottom)
> > all of these variables   $Box_Top;$Box_Right;$Box_Bottom  > 0
> >
> > ** - In debugger (and in execution of code) :
> > OBJECT GET
> >
> COORDINATES(*;$"Actual_Object_Name";$Box_Left;$Box_Top;$Box_
> Right;$Box_Bottom)
> > all of these variables   $Box_Top;$Box_Right;$Box_Bottom  **Equal** 0
> > (zero)
> >
> > I do not understand how this is!
> > Same form, same window, same process, same call chain, just one step
> > deeper
> > The object exists! It was moved into its location in the step (above
> > call chain) 'place boxes, day numbers etc'.  I can see it being put
> > into place, while debugging!!
> >
> > thanks
> > Chip
> > **
> > 4D Internet Users Group (4D iNUG)
> > FAQ:  http://lists.4d.com/faqnug.html
> > Archive:  http://lists.4d.com/archives.html
> > Options: http://lists.4d.com/mailman/options/4d_tech
> > Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> > **
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
>
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: v13 - Object get Coordinates

2016-09-01 Thread Chip Scheide
as a followup - when I exit the method where there is a zero coordinate 
value he coordinates are again available.

On Thu, 1 Sep 2016 12:29:36 -0400, Chip Scheide wrote:
> any ideas as to why this command is returning all 0's ?
> 
> I am in a call chain:
> New process
>  Opened window
>   entry form (calendar)
>Form method
> Project method for form (on outside call)
>  redraw calendar
>   place boxes, day numbers etc *
>Place appointments/events *
> actually move text objects for appts/events **
> 
> * - In debugger (and in execution of code) : 
> OBJECT GET 
> 
COORDINATES(*;$"Actual_Object_Name";$Box_Left;$Box_Top;$Box_Right;$Box_Bottom)
> all of these variables   $Box_Top;$Box_Right;$Box_Bottom  > 0
> 
> ** - In debugger (and in execution of code) :
> OBJECT GET 
> 
COORDINATES(*;$"Actual_Object_Name";$Box_Left;$Box_Top;$Box_Right;$Box_Bottom)
> all of these variables   $Box_Top;$Box_Right;$Box_Bottom  **Equal** 0 
> (zero)
> 
> I do not understand how this is!
> Same form, same window, same process, same call chain, just one step 
> deeper
> The object exists! It was moved into its location in the step (above 
> call chain) 'place boxes, day numbers etc'.  I can see it being put 
> into place, while debugging!!
> 
> thanks
> Chip
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: v13 - Object get Coordinates

2016-09-01 Thread Douglas von Roeder
On Thu, Sep 1, 2016 at 9:29 AM, Chip Scheide <4d_o...@pghrepository.org>
wrote:

> OBJECT GET
> COORDINATES(*;*$"Actual_Object_Name"*;$Box_Left;$Box_Top;$Box_
> Right;$Box_Bottom)
>



--
Douglas von Roeder
949-336-2902
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

v13 - Object get Coordinates

2016-09-01 Thread Chip Scheide
any ideas as to why this command is returning all 0's ?

I am in a call chain:
New process
 Opened window
  entry form (calendar)
   Form method
Project method for form (on outside call)
 redraw calendar
  place boxes, day numbers etc *
   Place appointments/events *
actually move text objects for appts/events **

* - In debugger (and in execution of code) : 
OBJECT GET 
COORDINATES(*;$"Actual_Object_Name";$Box_Left;$Box_Top;$Box_Right;$Box_Bottom)
all of these variables   $Box_Top;$Box_Right;$Box_Bottom  > 0

** - In debugger (and in execution of code) :
OBJECT GET 
COORDINATES(*;$"Actual_Object_Name";$Box_Left;$Box_Top;$Box_Right;$Box_Bottom)
all of these variables   $Box_Top;$Box_Right;$Box_Bottom  **Equal** 0 
(zero)

I do not understand how this is!
Same form, same window, same process, same call chain, just one step 
deeper
The object exists! It was moved into its location in the step (above 
call chain) 'place boxes, day numbers etc'.  I can see it being put 
into place, while debugging!!

thanks
Chip
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: New 4D v15 DB--What foundational decisions are important...?

2016-09-01 Thread Walt Nelson
Robert,

Foundation 5.6.1 (current version) is v15 based.

Thanks,
Walt Nelson (Seattle)
New stuff coming!
www.foundationshell.com
w...@foundationshell.com

> On Aug 31, 2016, at 11:39 AM, Robert ListMail  wrote:
> 
> Walt, the current v5 Foundation is based on a v11 structure?
> 
> Thanks,
> 
> Robert
> 
>> On Aug 21, 2015, at 10:43 PM, Walt Nelson  wrote:
>> 
>> www.foundationshell.com  and download the 
>> free demo.
>> 
>> When you purchase you receive ALL the source code, so you will not be left 
>> in the dark with how things work.

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Coloured button background

2016-09-01 Thread Arnaud de Montard

> Le 1 sept. 2016 à 04:30, Mitchell Shiller  a écrit :
> 
> Thanks Tom.
> 
> What I learned is that OBJECT SET COLOR works with regular buttons as your 
> demo shows.
> However, it does not work with 3D Buttons. I want to display an icon at the 
> same time.
> So I will roll my own.

Hi Mitchell, 
the 3d button, when it's set to "custom", allows a picture as background - a 
dog in this page:

In the properties list, these buttons have 2 references, icon and background. 
The last can be a colored rectangle. The source picture can be in Resource 
folder, picture library, variable. 
I ran a small test, with a Resource folder reference I don't get the background 
picture (bug, most probably) while with a picture from library or a variable 
it's OK.

Now if you want to change that color, get the string that describes the whole 
button format:
  $format_t:=OBJECT Get format(*;"buttont3dName")
You'll see a result like this:
  "Custom 
3D;#img/fieldTypes/Field_9.png;!MyBackgroundPictureVar;3;1;1;4;5;5;10;0;0;1"
where
   - Custom 3D = button title
   - #img/fieldTypes/Field_9.png = reference of the icon where "#" stands for 
"in Resource folder"
   - !MyBackgroundPictureVar = reference of the background where "!" stands for 
"in variable" 
Next step is to change the MyBackgroundPictureVar value, for example by 
generating a colored rectangle with svg:
  MyBackgroundPictureVar:=Pict_rectGet (Hasard_uuid)  //set a random color 
background
see 'Hasard_uuid' (to get a random number) here:
  
and 'Pict_rectGet' (from scratch):
***
  //Pict_rectGet (RGBcolor_l) -> img
  //returns a rectangle colored with $1
C_PICTURE($0)
C_LONGINT($1)
  //_
$svgRef:=SVG_New (120;20*4)
$RGBcolor_l:=$1
$txtColor_t:=SVG_Color_RGB_from_long ($1)
$X_l:=0
$largeur_l:=120
$hauteur_l:=18
$arrondiX:=5
$arrondiY:=10
$sp_l:=2
$tailleDuCrayon:=1
$frgndCol_t:=SVG_Color_RGB_from_long (0x00FF)
$bkgndCol_t:=SVG_Color_RGB_from_long ($RGBcolor_l)
ARRAY TEXT($bkgndCol_at;0)  //4 states
APPEND TO ARRAY($bkgndCol_at;SVG_Color_RGB_from_long ($RGBcolor_l))
APPEND TO ARRAY($bkgndCol_at;SVG_Color_RGB_from_long ($RGBcolor_l))
APPEND TO ARRAY($bkgndCol_at;SVG_Color_RGB_from_long ($RGBcolor_l))
APPEND TO ARRAY($bkgndCol_at;SVG_Color_RGB_from_long ($RGBcolor_l))
ARRAY TEXT($frgndCol_at;0)  //4 states
APPEND TO ARRAY($frgndCol_at;SVG_Color_RGB_from_long (0x))
APPEND TO ARRAY($frgndCol_at;SVG_Color_RGB_from_long (0x00FF))
APPEND TO ARRAY($frgndCol_at;SVG_Color_RGB_from_long (0x00FF))
APPEND TO ARRAY($frgndCol_at;SVG_Color_RGB_from_long (0x00AA))
For ($i_l;1;4)
$Y_l:=($i_l-1)*20
$rectID_t:=SVG_New_rect 
($svgRef;$X_l;$Y_l+2;$largeur_l+10;$hauteur_l-2;\

$arrondiX;$arrondiY;$bkgndCol_at{$i_l};$bkgndCol_at{$i_l};$tailleDuCrayon)
End for 
$0:=SVG_Export_to_picture ($svgRef)
  //_
***

-- 
Arnaud de Montard 

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: v15 DLL Plugin Issue

2016-09-01 Thread Randy Jaynes
Is it a path issue with how Windows is seamlessly running things out of the 
C:/ProgramData folder when your application is in C:/Program Files?

That could screw up paths in our code.

Randy

--
Randy Jaynes
Senior Programmer and Customer Support

http://printpoint.com • (845) 359-0298 • PrintPoint, Inc • 57 Ludlow Lane • 
Palisades, NY 10964 


 

> On Sep 1, 2016, at 10:38 AM, Douglas Cryer  wrote:
> 
> I have an issue which is quickly becoming a major issue with a Plugin that 
> was working and is now no longer working since upgrading to v15.
> 
> The plugin wqs originally written with DLLWizard as a WIN4DX header to a DLL. 
>  It calls an address lookup solution by passing a postcode.
> 
> It was then converted to the new Plugin architecture via plugin wizard 
> (although I am unsure of the settings that were used).  This has worked for 
> the past few years with v13 and appeared to work with v15 but since deploying 
> it in on one of the few clients who use this PAF solution we have found that 
> it no longer works with v15.  The plugin shows and the code compiles but at 
> runtime it does not work.
> 
> As far as I can tell the internal path to the DLL is not resolving or there 
> is an issue with how the plugin is 
> 
> I may need help more than just advice with this as each day that goes by 
> means a client is unable to use the functionality.
> 
> Any ideas are welcomed.  Ideally what I need is a way of directly creating a 
> new style plugin from the DLL like the old DLL Wizard process which is sadly 
> missed.
> 
> Regards,  Dougie
> 
> 
> telekinetix Limited- J. Douglas Cryer
> Phone : 01234 761759  Mobile : 07973 675 218
> 2nd Floor Broadway House, 4-6 The Broadway, Bedford MK40 2TE
> Email : jdcr...@telekinetix.com  Web : http://www.telekinetix.com
> 
> 
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: Upgrading 2004 to v15

2016-09-01 Thread Myriad List
> From: Doug Hall 
> To: 4D iNug Technical <4d_tech@lists.4d.com>
> Subject: Upgrading 2004 to v15

RE:  Should I shoot for an interim version, say v13, or is
it possible (practical) to go all the way from 2004 to v15?

Doug;

Definitely do not bother with incremental version upgrading unless you are in 
version 2003 or before and then all you need do is convert to 2004 and then 
straight to v15.  v15 is much better at the conversion and properly auto 
populates the new primary keys.  While I don’t recall which versions, some 
earlier versions (v13 - v14?) had an issue where updating the final datafile 
did not populate and save the new keys so you had to write code to fill them 
in.  v15 handles this very fast.  

v2004 has a unique checkbox when running 4D Tools Repair Structure “Rebuild all 
forms”.  You must do this with 2004 Tools or many of your forms will function 
like static pictures of what once were tab-able objects.  I’m not going to get 
into why other than make sure you do this or you will be starting over in 2004 
or rewriting lots of forms later.

I have done quite a few from 2004 to v15 and the process can be fairly simple 
to complex depending on:

- plugins used
- web application situation (some such as contextual have to be completely 
re-written)
- how many deprecated commands you have used
- how many deprecated objects such as “linked arrays” you have on forms
- how far back in the 4D family your application originated (just more issues)
apps written in 2004 and later will convert quicker and easier than 
apps that originated in v1.04

Consider this before you get in too deep:

- Read the all 4D upgrade documents carefully as much is covered there

- Reach out to Bob Miller with Parker Hannifin as he did a session at the 4D 
2016 Summit that went into great detail on "Upgrade Phobia".  No sense in 
covering what has all been so adequately done.  Most applications will be 
affected by a small fraction of all the upgrading issues so do not be 
discouraged by all the possibilities.  Its not that difficult unless you start 
converting before you digest the relevant material and have to re-do your work 
(which I did several times by the way)

- Try to Locate Thomas Maul’s summit session documents on conversions (2014 ? 
2015? I don’t recall) .  He too had some helpful material.

Maybe your 4D sales rep will help you obtain these docs as I’m sure 
they would be happy if you upgraded.  I’m not sure how publicly available they 
are.  They cover the nuances and hindsight that the 4D docs don’t have.

Some hindsight information I picked up:

The consensus of deprecated commands that are replaced with __o__ seems to be 
leave them alone for now rather than globally replacing them (unless you have 
lots of extra time for the conversion).  There is code out there that will go 
through your methods and update them all but the thought was you will lose 
track of where all these instances were.  The application will run as is 
because the commands still function.  This allows you to later go through the 
code and replace them making sure there are no unintended consequences.  An 
example of that would be if you relied on set string lengths of variables to 
control input.  C_string(12;…) will now function as C_TEXT(), so your converted 
app may have some string bugs but it will run.

Note that much has already been said about Primary Keys so I’m only going to 
touch on summary of what I took away.

- UUID or LI is a personal preference - both work fine
- UUID would be better for syncing with outside data sources
- LI is a bit faster/smaller and more “human readable” if you have to pick 
through any data some day
- Its always safe to simply let 4D create a new ID field (your preference UUID 
or LI)
- Some developers with legacy applications decided to use these primary keys 
only for 4Ds journaling and leave their legacy key systems in place.  Let 4D 
create keys for all tables just to allow the new 4D journaling.  Its fast and 
datafile space is cheap these days.
- If you have an obvious field that is unique and can function as a LI key it 
is certainly safe to use it.

John Bernhoft
Myriad Systems LLC


**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

v15 DLL Plugin Issue

2016-09-01 Thread Douglas Cryer
I have an issue which is quickly becoming a major issue with a Plugin that was 
working and is now no longer working since upgrading to v15.

The plugin wqs originally written with DLLWizard as a WIN4DX header to a DLL.  
It calls an address lookup solution by passing a postcode.

It was then converted to the new Plugin architecture via plugin wizard 
(although I am unsure of the settings that were used).  This has worked for the 
past few years with v13 and appeared to work with v15 but since deploying it in 
on one of the few clients who use this PAF solution we have found that it no 
longer works with v15.  The plugin shows and the code compiles but at runtime 
it does not work.

As far as I can tell the internal path to the DLL is not resolving or there is 
an issue with how the plugin is 

I may need help more than just advice with this as each day that goes by means 
a client is unable to use the functionality.

Any ideas are welcomed.  Ideally what I need is a way of directly creating a 
new style plugin from the DLL like the old DLL Wizard process which is sadly 
missed.
  
Regards,  Dougie


telekinetix Limited- J. Douglas Cryer
Phone : 01234 761759  Mobile : 07973 675 218
2nd Floor Broadway House, 4-6 The Broadway, Bedford MK40 2TE
Email : jdcr...@telekinetix.com  Web : http://www.telekinetix.com





**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

AW: 4D Shell or not so much...?

2016-09-01 Thread flury olivier
Hi,

It depends what you mean by shell.

IMO any "generic" function (methods, UI's) can be considered (may be part of) a 
shell. Ideally as a component, so it can be easily moved from one application 
to the other.

Example: a method that puts a CSV file into a 2D Array. Or a type ahead 
component (as an alternative to popups or combo boxes). Or the progress bar 
component provided by 4D.

The basic idea: do not invent the wheel each time, create reusable modules 
instead; save time - nothing new.

The data browser component for example. It is a component and uses a few of the 
functions of the utility component. The utility component itself can be used in 
any host database and offers more than 200 generic methods. Most of them are 
very basic, some are more sophisticated. My current personal favorite: 
Uty_PrintListBox (well, could be improved, but anyway).

The data browser component could be used as a "classic" shell. It contains a 
relatively powerful set of features to "browse" a database: search, sort, save 
selections (as sets), UI based set operators, cross database navigation, 
import/export functions, user based save of settings as JSON file (displayed 
tables and fields, column width, sorted field, sort order, input form per table 
etc.) and it also includes a sample of a generic subform that can be 
implemented on an input form, that allows to move from one record to the other 
(first, previous, next, last).

I would not want to start a new project (or take over an existing one) without 
my components. To answer your question: IMO, the idea of a shell (or generic, 
reusable functions) is still alive and relevant.

BTW: I published the latest version of the data browser (including utility 
component) today:

https://www.asuswebstorage.com/navigate/s/AC4441C0C5384321AEB93A76C764FCD8W

As always: free and source (both components) included.

Best,

Olivier

-Ursprüngliche Nachricht-
Von: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] Im Auftrag von Robert 
ListMail
Gesendet: Mittwoch, 31. August 2016 21:30
An: 4D iNug Tech <4d_tech@lists.4d.com>
Betreff: 4D Shell or not so much...?

It was recently suggested to me that the value of using a 4D-based shell is 
less important now… and that I should consider new 4D applications from 
scratch. I’ve created more apps with a shell than without with great 
success—that is, I’ve been a shell guy for the most part snd i do see the 
value. With that said, I was trying to find the private email from those that 
suggested, and recognized value, with the non-shell approach. Thoughts about 
new v15-based 4D projects via a shell or not? Why is a shell less relevant 
today?


**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Using ListBoxes as Output forms

2016-09-01 Thread Arnaud de Montard

> Le 1 sept. 2016 à 00:19, Sannyasin Siddhanathaswami  a 
> écrit :
> 
> I’m still stuck on not being able to get a complex sort from a selection so I 
> can do a sort again after changing the selection. I guess I need to add a 
> feature request. Not having this limits the usefulnees of listboxes as an 
> output form. For this need, I’ll keep using ALP. I guess some of my output 
> forms don’t really need this feature, but they could benefit from it.
> 
> A “Apply last sort” function would be fantastic!


In a listbox, AFAIK there are only 2 solutions to sort:
- let the automatic mechanism (clic on header = sort on this column)
- run your own 
You can't get "from nothing", but can't you set when it happens what you'll get 
later?

-- 
Arnaud de Montard 

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Can't Save Record Mandatory field is null

2016-09-01 Thread Arnaud de Montard

> Le 1 sept. 2016 à 00:34, Sannyasin Siddhanathaswami  a 
> écrit :
> 
> Aloha Kirk, Good hint. I’ll look at related tables/fields for mandatory. I’ll 
> also double check I have primary keys on everything. I thought I did.
> 
> Chip, unfortunately I get this error when I try to save a record with code 
> without loading a form.

Hi, 
note that the code you send detects mandatory fields but not primary keys… 
while PKs *are* mandatory. 

-- 
Arnaud de Montard

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Using ListBoxes as Output forms

2016-09-01 Thread Nigel Greenlee
Alan.

I have been using listbox for output since V12 or 13-whenever they brought in 
Field based listboxes. 

Acrually since V13 you can stop the left (or whatever you want) box scrolling 
off. I allow users to define the ‘locked’ columns. and the addition of column 
totals in V13 was also a big winner for LB based forms.


I have one output form-which covers my whole database and it has two listbox 
areas for display on it-only one shown at any one time. The array based is used 
for some tables where there is a recursive relationship in the table to I 
needed a hierarchical kind of  view.

This form which has a significicant number of features-such as user defined 
views(admin can set up the fields displayed),inclusion of formula based columns 
in the fields based listbox and automated personal settings remembering column 
widths and sort orders and  includes dynamically built contextual menus-with 
user added menu items for reports and some functions,  and some interesting 
enhancements such as filters(a kind of search that remembers the unfiltered 
selection) split views(for showing statistics) user lists(allowing users to 
have remembered searches or selections of records) easy table to table 
navigation(finding related records), contextual tabs of related tables etc etc.

 Getting to that level of sophistication was indeed some serious 
work-especially on a large system where replacing over 100 menu bars with a 
dynamically build system was a marathon in itself.


I also created another simpler form which is used as an export wizard which is 
always array based and I was surprised as in the past(Pre-v12) when i tried 
array based this could be rather painful with large tables(1million+) but now 
with even a large selections you can create a fast loading form. Its fairly 
easy(I say as i have done it and any pain is now a distant memory) to 
dynamically clear and assign a group of arrays to a listbox area, i would 
expect the challenges would be about understanding how the user might expect 
information to relate to other tables especially if you kind of ‘fooling’ them 
into feeling this external data is part of the database(for example you might 
have an external view of UPS deliveries and a user might expect to be able to 
navigate from the ‘order number’ on the deliver to the order which is in the 
database). 

I would certainly recommend using Table based for the internal forms and only 
switching to array based only for the external data. The display of data in 
field based is easier to deal with.

Hope this helps

Nigel Greenlee 

> On 30 Aug 2016, at 21:48, Alan Tilson  wrote:
> 
> Hello everyone,
> 
> Is there anything new to add to this discussion?
> 
> I'm looking for a way to display records from an external database synced
> with records stored in 4D.
> 
> Most of the time there is a matching 4D table but there could also be times
> where all the data is coming from an external source, so I suppose I am
> talking about array based listboxes.
> 
> As Walt said to start this thread, I'd rather not reinvent the wheel!
> 
> And right now we are using v13.6 but are planning on moving to v15 before
> too long, so I'd love to find something that could work in both places.
> 
> Thanks,
> Alan
> 
> On Mon, Feb 14, 2011 at 9:56 AM, Ortwin Zillgen  wrote:
> 
>>> Walt, we looked at replacing output forms with list boxes - until we
>>> realised that they had the same problem that output forms have - you
>>> cannot stop the left column (say, the ID field) from scrolling off
>>> screen when the list is wider than the window and you scroll right.
>>> 
>>> At least, that's the way it was in early v11.
>>> If later v11 or v12 has *finally* added a "freeze column" ability, I
>>> would be very pleased to hear it.
>>> I know AreaList does that.
>> 
>> planned for V13
>> 
>> splitting in V2004, sort of
>> 
>> and footers, too
>> 
>> 
>> 
>> Regards
>> Ortwin Zillgen
>> ___
>> Stadt Land Fluß * Geographic Informationsystems
>>    
>> RSS 
>> RSS 
>> member of developer-network 
>> 
>> **
>> 4D v12.1 is Available - Now Powered with 64-bit server
>> http://www.4d.com/products/new.html
>> 
>> 4D Internet Users Group (4D iNUG)
>> FAQ:  http://lists.4d.com/faqnug.html
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
>> 
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
>